gh-133703: dict: fix calculate_log2_keysize() (GH-133809)

(cherry picked from commit 92337f666e)
This commit is contained in:
Inada Naoki 2025-05-11 15:14:11 +09:00 committed by GitHub
parent 26b6ab49e4
commit f0a88e2ce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 7 deletions

View file

@ -1120,10 +1120,8 @@ class DictTest(unittest.TestCase):
a = C()
a.x = 1
d = a.__dict__
before_resize = sys.getsizeof(d)
d[2] = 2 # split table is resized to a generic combined table
self.assertGreater(sys.getsizeof(d), before_resize)
self.assertEqual(list(d), ['x', 2])
def test_iterator_pickling(self):