diff options
author | Guido van Rossum <guido@python.org> | 2007-11-22 00:55:51 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-11-22 00:55:51 +0000 |
commit | 64c06e327d48150fc548cf18a4a7ae0b890e69fa (patch) | |
tree | daf53ab57c369a3d92c5a9deafc41df2ccd96127 /Lib/test/mapping_tests.py | |
parent | cc7f26bf207ee17e2c1b3e6545e145942aff612d (diff) | |
download | cpython-git-64c06e327d48150fc548cf18a4a7ae0b890e69fa.tar.gz |
Backport of _abccoll.py by Benjamin Arangueren, issue 1383.
With some changes of my own thrown in (e.g. backport of r58107).
Diffstat (limited to 'Lib/test/mapping_tests.py')
-rw-r--r-- | Lib/test/mapping_tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py index 4b0f797fbf..c6857abcb2 100644 --- a/Lib/test/mapping_tests.py +++ b/Lib/test/mapping_tests.py @@ -557,6 +557,8 @@ class TestHashMappingProtocol(TestMappingProtocol): class BadEq(object): def __eq__(self, other): raise Exc() + def __hash__(self): + return 24 d = self._empty_mapping() d[BadEq()] = 42 @@ -642,6 +644,8 @@ class TestHashMappingProtocol(TestMappingProtocol): class BadCmp(object): def __eq__(self, other): raise Exc() + def __hash__(self): + return 42 d1 = self._full_mapping({BadCmp(): 1}) d2 = self._full_mapping({1: 1}) |