mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115)
This commit is contained in:
parent
c97d3af239
commit
c32dc47aca
35 changed files with 787 additions and 537 deletions
|
@ -1044,20 +1044,13 @@ class TestInstanceDict(unittest.TestCase):
|
|||
c.a = 1
|
||||
c.b = 2
|
||||
c.__dict__
|
||||
self.assertIs(
|
||||
_testinternalcapi.get_object_dict_values(c),
|
||||
None
|
||||
)
|
||||
self.assertEqual(c.__dict__, {"a":1, "b": 2})
|
||||
|
||||
def test_dict_dematerialization(self):
|
||||
c = C()
|
||||
c.a = 1
|
||||
c.b = 2
|
||||
c.__dict__
|
||||
self.assertIs(
|
||||
_testinternalcapi.get_object_dict_values(c),
|
||||
None
|
||||
)
|
||||
for _ in range(100):
|
||||
c.a
|
||||
self.assertEqual(
|
||||
|
@ -1072,10 +1065,6 @@ class TestInstanceDict(unittest.TestCase):
|
|||
d = c.__dict__
|
||||
for _ in range(100):
|
||||
c.a
|
||||
self.assertIs(
|
||||
_testinternalcapi.get_object_dict_values(c),
|
||||
None
|
||||
)
|
||||
self.assertIs(c.__dict__, d)
|
||||
|
||||
def test_dict_dematerialization_copy(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue