summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2008-07-15 14:27:37 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2008-07-15 14:27:37 (GMT)
commit53663a695ef2bb96ac0252cd4cc4aa40d4f953be (patch)
treee241ef71b353f8b3162179b1eed5a3f4eaae0c5f /Lib/decimal.py
parent9ace15ca25e1e72e1b943190a5f4efbd7d118de3 (diff)
downloadcpython-53663a695ef2bb96ac0252cd4cc4aa40d4f953be.zip
cpython-53663a695ef2bb96ac0252cd4cc4aa40d4f953be.tar.gz
cpython-53663a695ef2bb96ac0252cd4cc4aa40d4f953be.tar.bz2
Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index c94e1be..a545cf8 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -3697,10 +3697,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)"""