mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-117750: When clearing object's dict, clear inline values but leave dict attached (GH-117808)
This commit is contained in:
parent
7d0be7aea5
commit
784e076a10
3 changed files with 31 additions and 15 deletions
|
@ -862,6 +862,16 @@ class TestInlineValues(unittest.TestCase):
|
|||
self.assertFalse(has_inline_values(c))
|
||||
self.check_100(c)
|
||||
|
||||
def test_bug_117750(self):
|
||||
"Aborted on 3.13a6"
|
||||
class C:
|
||||
def __init__(self):
|
||||
self.__dict__.clear()
|
||||
|
||||
obj = C()
|
||||
self.assertEqual(obj.__dict__, {})
|
||||
obj.foo = None # Aborted here
|
||||
self.assertEqual(obj.__dict__, {"foo":None})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue