commit | e1d665a90e4a20a60c0c9904417160ea3c7660b7 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Mon Apr 05 18:53:43 2010 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Mon Apr 05 18:53:43 2010 +0000 |
tree | b70e4a64cd4a6a5ec6023fbe35069b4eb5af37fc | |
parent | 5e0c2748fb2e16b3b0f33f0bb55f1aaa1272f887 [diff] [blame] |
Classes that override __eq__ also need to define __hash__.
diff --git a/Lib/functools.py b/Lib/functools.py index ad1cccc..539dc90 100644 --- a/Lib/functools.py +++ b/Lib/functools.py
@@ -93,4 +93,6 @@ 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') return K