diff options
author | Raymond Hettinger <python@rcn.com> | 2003-11-22 03:55:23 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-11-22 03:55:23 (GMT) |
commit | bfd334a42d35e58369e3a53e16733234e2741975 (patch) | |
tree | 321b419c239c475b52fb6272f0a0b26e8de1fb7d /Lib | |
parent | 5a5b243043aacd6c4ba2b06089cc255075ddc262 (diff) | |
download | cpython-bfd334a42d35e58369e3a53e16733234e2741975.zip cpython-bfd334a42d35e58369e3a53e16733234e2741975.tar.gz cpython-bfd334a42d35e58369e3a53e16733234e2741975.tar.bz2 |
Extend temporary hashability to remove() and discard().
Brings the functionality back in line with sets.py.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_set.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 3203d51..85f87f7 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -182,12 +182,22 @@ class TestSet(TestJointOps): self.assert_('a' not in self.s) self.assertRaises(KeyError, self.s.remove, 'Q') self.assertRaises(TypeError, self.s.remove, []) + s = self.thetype([frozenset(self.word)]) + self.assert_(self.thetype(self.word) in s) + s.remove(self.thetype(self.word)) + self.assert_(self.thetype(self.word) not in s) + self.assertRaises(KeyError, self.s.remove, self.thetype(self.word)) def test_discard(self): self.s.discard('a') self.assert_('a' not in self.s) self.s.discard('Q') self.assertRaises(TypeError, self.s.discard, []) + s = self.thetype([frozenset(self.word)]) + self.assert_(self.thetype(self.word) in s) + s.discard(self.thetype(self.word)) + self.assert_(self.thetype(self.word) not in s) + s.discard(self.thetype(self.word)) def test_pop(self): for i in xrange(len(self.s)): |