mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Manual forward port of 64962 - use PyObject_HashNotImplemented as a tp_hash level indicator that the default hash implementation has not been inherited
This commit is contained in:
parent
e65282114e
commit
d1abd25ed8
12 changed files with 122 additions and 94 deletions
|
@ -212,8 +212,7 @@ class CommonTest(unittest.TestCase):
|
|||
# So instances of AllEq must be found in all non-empty sequences.
|
||||
def __eq__(self, other):
|
||||
return True
|
||||
def __hash__(self):
|
||||
raise NotImplemented
|
||||
__hash__ = None # Can't meet hash invariant requirements
|
||||
self.assert_(AllEq() not in self.type2test([]))
|
||||
self.assert_(AllEq() in self.type2test([1]))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue