summaryrefslogtreecommitdiffstats
path: root/Lib/functools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-05-03 18:01:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-05-03 18:01:32 (GMT)
commit003be529323a395be4a17c779aff7e4737170bbf (patch)
tree77277ef2fa91c41d4beed7dd1f4b2dc9da1f26ae /Lib/functools.py
parent5098d44354d612445aa2dd97a304ed0c0660f236 (diff)
downloadcpython-003be529323a395be4a17c779aff7e4737170bbf.zip
cpython-003be529323a395be4a17c779aff7e4737170bbf.tar.gz
cpython-003be529323a395be4a17c779aff7e4737170bbf.tar.bz2
Fix __hash__ in functools.cmp_to_key() to work with collections.Hashable.
Diffstat (limited to 'Lib/functools.py')
-rw-r--r--Lib/functools.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/functools.py b/Lib/functools.py
index e92a2fc..90642a5 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -111,8 +111,7 @@ def cmp_to_key(mycmp):
return mycmp(self.obj, other.obj) >= 0
def __ne__(self, other):
return mycmp(self.obj, other.obj) != 0
- def __hash__(self):
- raise TypeError('hash not implemented')
+ __hash__ = None
return K
_CacheInfo = namedtuple("CacheInfo", "hits misses maxsize currsize")