commit | 003be529323a395be4a17c779aff7e4737170bbf | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Tue May 03 11:01:32 2011 -0700 |
committer | Raymond Hettinger <python@rcn.com> | Tue May 03 11:01:32 2011 -0700 |
tree | 77277ef2fa91c41d4beed7dd1f4b2dc9da1f26ae | |
parent | 5098d44354d612445aa2dd97a304ed0c0660f236 [diff] [blame] |
Fix __hash__ in functools.cmp_to_key() to work with collections.Hashable.
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 @@ 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")