Comment #1 on issue 1973 by asmeurer: hash(Integer) should return the int
http://code.google.com/p/sympy/issues/detail?id=1973

Apply this patch:

diff --git a/sympy/core/numbers.py b/sympy/core/numbers.py
index 6924826..9cc7968 100644
--- a/sympy/core/numbers.py
+++ b/sympy/core/numbers.py
@@ -953,7 +953,7 @@ def __le__(a, b):
         return Rational.__le__(a, b)

     def __hash__(self):
-        return super(Integer, self).__hash__()
+        return hash(self.p)

     ########################################

Gives these test failures:


________________________________________________________________________________
______________ sympy/series/tests/test_nseries.py:test_log_series ______________ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/series/tests/test_nseries.py", line 72, in test_log_series
    log(x)**(-4) + O(log(x)**(-5))
AssertionError
________________________________________________________________________________
_______________ sympy/series/tests/test_nseries.py:test_series2x _______________ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/series/tests/test_nseries.py", line 117, in test_series2x
    assert ((1/x+1)**3).nseries(x,0,3)== 1+x**(-3)+3*x**(-2)+3/x
AssertionError
________________________________________________________________________________
_______ sympy/solvers/tests/test_ode.py:test_1st_homogeneous_coeff_ode2 ________ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/solvers/tests/test_ode.py", line 495, in test_1st_homogeneous_coeff_ode2
    assert dsolve(eq2, f(x), hint='1st_homogeneous_coeff_best') == sol2
AssertionError
________________________________________________________________________________
__ sympy/solvers/tests/test_ode.py:test_nth_linear_constant_coeff_homogeneous __ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/solvers/tests/test_ode.py", line 661, in test_nth_linear_constant_coeff_homogeneous
    assert dsolve(eq25, f(x)) in (sol25, sol25s)
AssertionError
________________________________________________________________________________
_____ sympy/solvers/tests/test_ode.py:test_undetermined_coefficients_match _____ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/solvers/tests/test_ode.py", line 759, in test_undetermined_coefficients_match
    sin(x - 2)])}
AssertionError
________________________________________________________________________________
__________ sympy/solvers/tests/test_solvers.py:test_solve_polynomial1 __________ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/solvers/tests/test_solvers.py", line 120, in test_solve_polynomial1
    -2 - 3**Rational(1,2) ]
AssertionError

 tests finished: 2047 passed, 6 failed, 3 skipped, 52 expected to fail,
in 301.48 seconds
DO *NOT* COMMIT!


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to