aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_dataclasses/__init__.py
diff options
context:
space:
mode:
authorAviel Boag <avboag@gmail.com>2024-03-19 02:53:14 +0200
committerGitHub <noreply@github.com>2024-03-18 18:53:14 -0600
commita22d05f04c074dbb4f71e7837f54c0bb693db75d (patch)
treea7634e879f7d77156e15f73402924ff21c92b976 /Lib/test/test_dataclasses/__init__.py
parent1d82a41235ac5619d36ac7e289fcbb686c1d9350 (diff)
downloadcpython-a22d05f04c074dbb4f71e7837f54c0bb693db75d.tar.gz
cpython-a22d05f04c074dbb4f71e7837f54c0bb693db75d.zip
gh-105866: fix dataclass with slots=True, weakref_slot=True (#105870)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.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__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_dataclasses/__init__.py b/Lib/test/test_dataclasses/__init__.py
index ede74b0dd15..e27abac5111 100644
--- a/Lib/test/test_dataclasses/__init__.py
+++ b/Lib/test/test_dataclasses/__init__.py
@@ -3498,6 +3498,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.