Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Commit6e1b31b
[3.14]gh-135228: When@DataClass(slots=True) replaces a dataclass, make the original class collectible (GH-136893) (#136960)
gh-135228: When@DataClass(slots=True) replaces a dataclass, make the original class collectible (GH-136893)An interesting hack, but more localized in scope thanGH-135230.This may be a breaking change if people intentionally keep the original class aroundwhen using `@dataclass(slots=True)`, and then use `__dict__` or `__weakref__` on theoriginal class.(cherry picked from commit46cbdf9)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>1 parentcaef946 commit6e1b31b
File tree
3 files changed
+54
-0
lines changed- Lib
- test/test_dataclasses
- Misc/NEWS.d/next/Library
3 files changed
+54
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1341 | 1348 | | |
1342 | 1349 | | |
1343 | 1350 | | |
| |||
1732 | 1739 | | |
1733 | 1740 | | |
1734 | 1741 | | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3804 | 3804 | | |
3805 | 3805 | | |
3806 | 3806 | | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
| 3814 | + | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
3807 | 3842 | | |
3808 | 3843 | | |
3809 | 3844 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments
Comments
(0)