New issue 2740: hash() does not raise TypeError when tp_hash=0 and 
tp_richcompare!=0
https://bitbucket.org/pypy/pypy/issues/2740/hash-does-not-raise-typeerror-when-tp_hash

Christoph Reiter:

Using pypy 5.10 + cpyext

The Python docs state: "When this field is not set, two possibilities exist: if 
the tp_compare and tp_richcompare fields are both NULL, a default hash value 
based on the object’s address is returned; otherwise, a TypeError is raised." 
https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_hash

I have a class which has tp_hash=0 and tp_richcompare!=0, and doing 
hash(instance) returns a hash and does not raise TypeError.


_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to