diff options
author | Raymond Hettinger <python@rcn.com> | 2011-05-03 18:16:36 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-05-03 18:16:36 (GMT) |
commit | e7a2430ddedd3d236e1741b047d133cf461eb0de (patch) | |
tree | 6abec258ede9b5b31d05211430620c606fc5ad21 /Lib/functools.py | |
parent | 4e787aeed6079bc3ddda13be8b18a4e8992cd561 (diff) | |
parent | 003be529323a395be4a17c779aff7e4737170bbf (diff) | |
download | cpython-e7a2430ddedd3d236e1741b047d133cf461eb0de.zip cpython-e7a2430ddedd3d236e1741b047d133cf461eb0de.tar.gz cpython-e7a2430ddedd3d236e1741b047d133cf461eb0de.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.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/functools.py b/Lib/functools.py index 098f6b6..b2bcc21 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 try: |