diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-15 15:46:38 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2008-07-15 15:46:38 (GMT) |
commit | d1abd25ed8e14a64da21d17ece73c49390b9b083 (patch) | |
tree | 21c0fbf58c0b0a05268ccdf538716f2f75dd5576 /Lib/decimal.py | |
parent | e65282114e96efb9e7eee77c57244943b746f6fe (diff) | |
download | cpython-d1abd25ed8e14a64da21d17ece73c49390b9b083.zip cpython-d1abd25ed8e14a64da21d17ece73c49390b9b083.tar.gz cpython-d1abd25ed8e14a64da21d17ece73c49390b9b083.tar.bz2 |
Manual forward port of 64962 - use PyObject_HashNotImplemented as a tp_hash level indicator that the default hash implementation has not been inherited
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 180b177..2c02f11 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -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)""" |