[Python-porting] bugs in 2to3 tools when porting sympy

Amaury Forgeot d'Arc amauryfa at gmail.com
Mon Jul 6 10:01:19 CEST 2009


Hello,

2009/7/6 Ondrej Certik <ondrej at certik.cz>:
> On Sun, Jul 5, 2009 at 6:54 PM, Ondrej Certik<ondrej at certik.cz> wrote:
> [...]
>> I have a serious problem that the __hash__
>> method is defined in the Basic() class, but in it's subclasses (Number
>> and Symbol):
>>
>> Number.__hash__
>>
>> returns None, but
>>
>> Symbol.__hash__
>>
>> correctly points to the Basic.hash method.

Number certainly defines a __eq__ method, which blocks the inheritance
of __hash__.
See the last paragraph of
http://docs.python.org/dev/py3k/reference/datamodel.html#object.__hash__

-- 
Amaury Forgeot d'Arc


More information about the Python-porting mailing list