diff options
author | Mark Shannon <mark@hotpy.org> | 2021-10-13 13:19:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 13:19:34 (GMT) |
commit | a8b9350964f43cb648c98c179c8037fbf3ff8a7d (patch) | |
tree | 13a539432c9d48ac278d34d040f17a7a12eac771 /Lib/test/test_dict.py | |
parent | 97308dfcdc0696e0b116c37386e2ff4d72e6c3f4 (diff) | |
download | cpython-a8b9350964f43cb648c98c179c8037fbf3ff8a7d.zip cpython-a8b9350964f43cb648c98c179c8037fbf3ff8a7d.tar.gz cpython-a8b9350964f43cb648c98c179c8037fbf3ff8a7d.tar.bz2 |
bpo-45340: Don't create object dictionaries unless actually needed (GH-28802)
* Never change types' cached keys. It could invalidate inline attribute objects.
* Lazily create object dictionaries.
* Update specialization of LOAD/STORE_ATTR.
* Don't update shared keys version for deletion of value.
* Update gdb support to handle instance values.
* Rename SPLIT_KEYS opcodes to INSTANCE_VALUE.
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r-- | Lib/test/test_dict.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 4014375..b43c83a 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -994,8 +994,8 @@ class DictTest(unittest.TestCase): @support.cpython_only def test_splittable_setdefault(self): - """split table must be combined when setdefault() - breaks insertion order""" + """split table must keep correct insertion + order when attributes are adding using setdefault()""" a, b = self.make_shared_key_dict(2) a['a'] = 1 @@ -1005,7 +1005,6 @@ class DictTest(unittest.TestCase): size_b = sys.getsizeof(b) b['a'] = 1 - self.assertGreater(size_b, size_a) self.assertEqual(list(a), ['x', 'y', 'z', 'a', 'b']) self.assertEqual(list(b), ['x', 'y', 'z', 'b', 'a']) |