[3.12] gh-105866: fix dataclass with slots=True, weakref_slot=True (GH-105870) (GH-116978)

(cherry picked from commit a22d05f04c)

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>
This commit is contained in:
Miss Islington (bot) 2024-03-19 11:57:31 +01:00 committed by GitHub
parent e1f890828e
commit 23f97327fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View file

@ -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.