summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-03-20 21:45:04 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-03-20 21:45:04 (GMT)
commitf94e89c57801ffdc17c7246704c7e1c41bbc4791 (patch)
tree2efd9f3a72c85f9417cc6e511de6399fe231ad13 /Lib
parent42f4cfa9b6612206258a0735f97c863cd14e2d03 (diff)
downloadcpython-f94e89c57801ffdc17c7246704c7e1c41bbc4791.zip
cpython-f94e89c57801ffdc17c7246704c7e1c41bbc4791.tar.gz
cpython-f94e89c57801ffdc17c7246704c7e1c41bbc4791.tar.bz2
Extend work on rev 52962 and 53830 eliminating redundant PyObject_Hash() calls and fixing set/dict interoperability.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_set.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 45f61b2..b46cac4 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -285,10 +285,14 @@ class TestJointOps(unittest.TestCase):
s = self.thetype(d)
self.assertEqual(sum(elem.hash_count for elem in d), n)
s.difference(d)
- self.assertEqual(sum(elem.hash_count for elem in d), n)
+ self.assertEqual(sum(elem.hash_count for elem in d), n)
if hasattr(s, 'symmetric_difference_update'):
s.symmetric_difference_update(d)
- self.assertEqual(sum(elem.hash_count for elem in d), n)
+ self.assertEqual(sum(elem.hash_count for elem in d), n)
+ d2 = dict.fromkeys(set(d))
+ self.assertEqual(sum(elem.hash_count for elem in d), n)
+ d3 = dict.fromkeys(frozenset(d))
+ self.assertEqual(sum(elem.hash_count for elem in d), n)
class TestSet(TestJointOps):
thetype = set