mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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>
This commit is contained in:
parent
1d82a41235
commit
a22d05f04c
3 changed files with 15 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue