mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +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
|
@ -3783,10 +3783,8 @@ class Context(object):
|
|||
for flag in flags:
|
||||
self._ignored_flags.remove(flag)
|
||||
|
||||
def __hash__(self):
|
||||
"""A Context cannot be hashed."""
|
||||
# We inherit object.__hash__, so we must deny this explicitly
|
||||
raise TypeError("Cannot hash a Context.")
|
||||
# We inherit object.__hash__, so we must deny this explicitly
|
||||
__hash__ = None
|
||||
|
||||
def Etiny(self):
|
||||
"""Returns Etiny (= Emin - prec + 1)"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue