PR review: Properly update closure cells for __setattr__ and __detattr__ in frozen dataclasses with slots

PR link: gh-105936: Properly update closure cells for `__setattr__` and `__detattr__` in frozen dataclasses with slots by Prometheus3375 · Pull Request #144021 · python/cpython · GitHub

It was already reviewed by one python member, but it still isn’t merged. This PR fixes the issue that appeared in frozen dataclasses with slots in 3.10. The issue was reported long time ago with the issue author also providing PR for the fix, but I recently rediscovered the issue and made the up-to-date patch. Older PR is gh-105936: Fix frozen dataclasses with slots' `__setattr__` and `__delattr_` by avboag · Pull Request #105937 · python/cpython · GitHub, it is heavily outdated, so I suggest to close it without merging.

I believe the patch can be backported automatically to 3.14. It would be nice to port it to 3.13 too, but it may require additional work.

1 Like