dict.update(other) must preserve order in other.
(self)
| 1056 | |
| 1057 | @support.cpython_only |
| 1058 | def test_splittable_update(self): |
| 1059 | """dict.update(other) must preserve order in other.""" |
| 1060 | class C: |
| 1061 | def __init__(self, order): |
| 1062 | if order: |
| 1063 | self.a, self.b, self.c = 1, 2, 3 |
| 1064 | else: |
| 1065 | self.c, self.b, self.a = 1, 2, 3 |
| 1066 | o = C(True) |
| 1067 | o = C(False) # o.__dict__ has reversed order. |
| 1068 | self.assertEqual(list(o.__dict__), ["c", "b", "a"]) |
| 1069 | |
| 1070 | d = {} |
| 1071 | d.update(o.__dict__) |
| 1072 | self.assertEqual(list(d), ["c", "b", "a"]) |
| 1073 | |
| 1074 | @support.cpython_only |
| 1075 | def test_splittable_to_generic_combinedtable(self): |
nothing calls this directly
no test coverage detected