Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
  • Loading branch information
JelleZijlstra and ncoghlan authored Jul 22, 2025
commit e0d61f7a8655e7a3f1fcc035e3c1b9fc4af4d9b4
3 changes: 2 additions & 1 deletion Lib/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,9 +1339,10 @@ 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
old_cls_dict = cls.__dict__ | _deproxier
Comment thread
JelleZijlstra marked this conversation as resolved.
old_cls_dict.pop('__weakref__', None)
old_cls_dict.pop('__dict__', None)
del cls.__weakref__
Comment thread
JelleZijlstra marked this conversation as resolved.
Outdated

return newcls

Expand Down
Loading