gh-112075: Make instance attributes stored in inline "dict" thread safe (#114742)

Make instance attributes stored in inline "dict" thread safe on free-threaded builds
This commit is contained in:
Dino Viehland 2024-04-21 22:57:05 -07:00 committed by GitHub
parent 1446024124
commit 8b541c017e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 419 additions and 142 deletions

View file

@ -873,6 +873,15 @@ class TestInlineValues(unittest.TestCase):
obj.foo = None # Aborted here
self.assertEqual(obj.__dict__, {"foo":None})
def test_store_attr_deleted_dict(self):
class Foo:
pass
f = Foo()
del f.__dict__
f.a = 3
self.assertEqual(f.a, 3)
if __name__ == '__main__':
unittest.main()