Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
[3.14] gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (take 2) (GH-137047)#137666
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ke the original class collectible (take 2) (pythonGH-137047)Remove the `__dict__` and `__weakref__` descriptors from the original class when creating a dataclass from it.An interesting hack, but more localized in scope thanpythongh-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 commit6859b95)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
!buildbot aarch64 Fedora Stable LTO . PGO |
bedevere-bot commentedAug 12, 2025
🤖 New build scheduled with the buildbot fleet by@hugovk for commitd764eb6 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F137666%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
4dda176 intopython:3.14Uh oh!
There was an error while loading.Please reload this page.
…ass, make the original class collectible (take 2) (pythonGH-137047) (python#137666)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Remove the
__dict__and__weakref__descriptors from the original class when creating a dataclass from it.An interesting hack, but more localized in scope thangh-135230.
This may be a breaking change if people intentionally keep the original class around
when using
@dataclass(slots=True), and then use__dict__or__weakref__on theoriginal class.
(cherry picked from commit6859b95)
Co-authored-by: Jelle Zijlstrajelle.zijlstra@gmail.com
Co-authored-by: Alyssa Coghlanncoghlan@gmail.com
Co-authored-by: Petr Viktorinencukou@gmail.com
Co-authored-by: Serhiy Storchakastorchaka@gmail.com