summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-31 18:09:11 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-31 18:09:11 (GMT)
commitd97eb0d338f3d5746ba4bbd3cfe6e7c28948d41e (patch)
tree4704ed3c037ea0e78224c15767d2ac04777491d9 /Lib/test/test_dict.py
parent616f8035a8d7cdbb34f8a6a485d8d9d83767d207 (diff)
parent275c848736f1c15efc15b84ced315218ac639899 (diff)
downloadcpython-d97eb0d338f3d5746ba4bbd3cfe6e7c28948d41e.zip
cpython-d97eb0d338f3d5746ba4bbd3cfe6e7c28948d41e.tar.gz
cpython-d97eb0d338f3d5746ba4bbd3cfe6e7c28948d41e.tar.bz2
merge 3.2 (#16345)
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index dd4d552..d1f3192 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -256,6 +256,14 @@ class DictTest(unittest.TestCase):
d = dict(zip(range(6), range(6)))
self.assertEqual(dict.fromkeys(d, 0), dict(zip(range(6), [0]*6)))
+ class baddict3(dict):
+ def __new__(cls):
+ return d
+ d = {i : i for i in range(10)}
+ res = d.copy()
+ res.update(a=None, b=None, c=None)
+ self.assertEqual(baddict3.fromkeys({"a", "b", "c"}), res)
+
def test_copy(self):
d = {1:1, 2:2, 3:3}
self.assertEqual(d.copy(), {1:1, 2:2, 3:3})