Looks good.  All such warnings are gone in Python2.7rc2, and all tests pass 
(except for the ones from issue 1970).  

So now, it looks like except for cmp vs. key and reduce, the rest should be 
doable with the 2to3.py tool (except for maybe the compiler module in 
assumptions.py, I don't know anything about that).  The reason that we can't 
just use functools.reduce() is that it doesn't exist in Python 2.4 and 2.5.  
The solution will have to be to write a custom reduce() in iterables.py like we 
have for any() and all(), or else rewrite the code to not use reduce(). 

Aaron Meurer
On Jul 5, 2010, at 4:20 AM, James Pearson wrote:

> I have just pushed a commit to a topic branch in my repo[0] that fixes the 
> warnings about __eq__ overriding __hash__ when sympy's tests are run with the 
> -3 flag.  Included below is the full commit message.  Comments?
> 
> [0]: http://github.com/xiongchiamiov/sympy/tree/2to3-support
> 
> ---------------------------------------------
> 
> Define __hash__ functions when __eq__ is overriden for Py3k support.
> 
> As hinted at in a bugreport[0] and implemented several years ago in the
> py3k branch[1], in Python 3, overriding __eq__ without explicitly
> defining __hash__ will cause __hash__ to be set to None.
> 
> I have merely defined __hash__ functions so that python2.7 rc2 will not
> display any warnings (about this) when run with the -3 flag. Since we
> had not defined __hash__ methods previously, they are just calls to the
> super-class's __hash__.
> 
> [0]: http://bugs.python.org/issue2235
> [1]: http://svn.python.org/view?view=rev&revision=51454
> --
> James Pearson
> --
> Most histories are written by the winners of conflicts, but those written by 
> the
> losers -- if they survive -- are often more interesting.
>   -- Iblis Ginjo, The Landscape of Humanity
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy-patches" group.
> To post to this group, send email to sympy-patc...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy-patches+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy-patches?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patc...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en.

Reply via email to