We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
python
Learn more about funding links in repositories.
Report abuse
1 parent f59c7f8 commit 636e9ddCopy full SHA for 636e9dd
Lib/test/test_dict.py
@@ -1094,6 +1094,21 @@ def __init__(self, order):
1094
d.update(o.__dict__)
1095
self.assertEqual(list(d), ["c", "b", "a"])
1096
1097
+ @support.cpython_only
1098
+ def test_splittable_to_generic_combinedtable(self):
1099
+ """split table must be correctly resized and converted to generic combined table"""
1100
+ class C:
1101
+ pass
1102
+
1103
+ a = C()
1104
+ a.x = 1
1105
+ d = a.__dict__
1106
+ before_resize = sys.getsizeof(d)
1107
+ d[2] = 2 # split table is resized to a generic combined table
1108
1109
+ self.assertGreater(sys.getsizeof(d), before_resize)
1110
+ self.assertEqual(list(d), ['x', 2])
1111
1112
def test_iterator_pickling(self):
1113
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
1114
data = {1:"a", 2:"b", 3:"c"}
0 commit comments