diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-03-19 10:57:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-19 10:57:31 (GMT) |
commit | 23f97327fe7001118b51a69084b571a3da2e0cf0 (patch) | |
tree | cb25657d8e42692e09b760b9e310880ba137f271 /Lib/test/test_dataclasses/__init__.py | |
parent | e1f890828e15d68a5e05a7edf2d53ca44b621c33 (diff) | |
download | cpython-23f97327fe7001118b51a69084b571a3da2e0cf0.zip cpython-23f97327fe7001118b51a69084b571a3da2e0cf0.tar.gz cpython-23f97327fe7001118b51a69084b571a3da2e0cf0.tar.bz2 |
[3.12] gh-105866: fix dataclass with slots=True, weakref_slot=True (GH-105870) (GH-116978)
(cherry picked from commit a22d05f04c074dbb4f71e7837f54c0bb693db75d)
Co-authored-by: Aviel Boag <avboag@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Carl Meyer <carl@oddbird.net>
Diffstat (limited to 'Lib/test/test_dataclasses/__init__.py')
-rw-r--r-- | Lib/test/test_dataclasses/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_dataclasses/__init__.py b/Lib/test/test_dataclasses/__init__.py index 639631c..4e05506 100644 --- a/Lib/test/test_dataclasses/__init__.py +++ b/Lib/test/test_dataclasses/__init__.py @@ -3403,6 +3403,17 @@ class TestSlots(unittest.TestCase): self.assertIs(a.__weakref__, a_ref) + def test_dataclass_derived_weakref_slot(self): + class A: + pass + + @dataclass(slots=True, weakref_slot=True) + class B(A): + pass + + B() + + class TestDescriptors(unittest.TestCase): def test_set_name(self): # See bpo-33141. |