summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2015-07-05 10:31:09 -0700
committerLarry Hastings <larry@hastings.org>2015-07-05 10:31:09 -0700
commitab30353adbef3a3fdd54fb30856af8ff94f2c108 (patch)
tree4c330aa36e455a7a6223e1488bc7a7a1b384b538 /Lib
parentb34db6ad9b3332c3101bcf7e020e90583693db20 (diff)
parent95f9dd5e72d6a72db0ad7438b65990cba30cf36b (diff)
downloadcpython-git-ab30353adbef3a3fdd54fb30856af8ff94f2c108.tar.gz
Merge with ongoing work in 3.5 branch.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_dict.py14
-rw-r--r--Lib/test/test_unpack_ex.py3
2 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 9553c66d14..2488b63474 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -937,6 +937,20 @@ class DictTest(unittest.TestCase):
d.popitem()
self.check_reentrant_insertion(mutate)
+ def test_merge_and_mutate(self):
+ class X:
+ def __hash__(self):
+ return 0
+
+ def __eq__(self, o):
+ other.clear()
+ return False
+
+ l = [(i,0) for i in range(1, 1337)]
+ other = dict(l)
+ other[X()] = 0
+ d = {X(): 0, 1: 1}
+ self.assertRaises(RuntimeError, d.update, other)
from test import mapping_tests
diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py
index 01f57b95e7..d27eef0397 100644
--- a/Lib/test/test_unpack_ex.py
+++ b/Lib/test/test_unpack_ex.py
@@ -128,6 +128,9 @@ Dict display element unpacking
... for i in range(1000)) + "}"))
1000
+ >>> {0:1, **{0:2}, 0:3, 0:4}
+ {0: 4}
+
List comprehension element unpacking
>>> a, b, c = [0, 1, 2], 3, 4