(self)
| 3685 | a.__weakref__ |
| 3686 | |
| 3687 | def test_slots_weakref(self): |
| 3688 | @dataclass(slots=True, weakref_slot=True) |
| 3689 | class A: |
| 3690 | a: int |
| 3691 | |
| 3692 | self.assertIn("__weakref__", A.__slots__) |
| 3693 | a = A(1) |
| 3694 | a_ref = weakref.ref(a) |
| 3695 | |
| 3696 | self.assertIs(a.__weakref__, a_ref) |
| 3697 | |
| 3698 | def test_slots_weakref_base_str(self): |
| 3699 | class Base: |