Skip to content

gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (take 2) #137047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 12, 2025
Prev Previous commit
Next Next commit
obsolete comment
  • Loading branch information
JelleZijlstra committed Jul 23, 2025
commit b9fb155331c85efcaef5af24a98e4a571a7f71e3
1 change: 0 additions & 1 deletion Lib/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,6 @@ def _add_slots(cls, is_frozen, weakref_slot, defined_fields):
break

# gh-135228: Make sure the original class can be garbage collected.
# Bypass mapping proxy to allow __dict__ to be removed
sys._clear_type_descriptors(cls)

return newcls
Expand Down
Loading