self.assertEqual(list(a), ['x', 'y'])
self.assertEqual(list(b), ['x', 'y', 'z'])
+ @support.cpython_only
+ def test_splittable_update(self):
+ """dict.update(other) must preserve order in other."""
+ class C:
+ def __init__(self, order):
+ if order:
+ self.a, self.b, self.c = 1, 2, 3
+ else:
+ self.c, self.b, self.a = 1, 2, 3
+ o = C(True)
+ o = C(False) # o.__dict__ has reversed order.
+ self.assertEqual(list(o.__dict__), ["c", "b", "a"])
+
+ d = {}
+ d.update(o.__dict__)
+ self.assertEqual(list(d), ["c", "b", "a"])
+
def test_iterator_pickling(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
data = {1:"a", 2:"b", 3:"c"}
-In :func:`typing.get_type_hints`, support evaluating stringified ``ParamSpecArgs`` and ``ParamSpecKwargs`` annotations. Patch by Gregory Beauregard.
\ No newline at end of file
+In :func:`typing.get_type_hints`, support evaluating stringified ``ParamSpecArgs`` and ``ParamSpecKwargs`` annotations. Patch by Gregory Beauregard.