-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-118033: Fix __weakref__
not set for generic dataclasses
#118099
Conversation
No, this is not correct, we also need to check |
Ubuntu failures are not related, there are some network problems right now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fix is correct; some suggestions and a question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me. Sorry I didn't see the notification sooner that you requested another review!
I still think the best version of this might look at __weakrefoffset__
and __dictrefoffset__
always to decide on those two slots, but I agree that's an edge case and can be handled separately; this is still a clear improvement and fixes the original bug.
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…ythonGH-118099) (cherry picked from commit fa9b9cb) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
…ythonGH-118099) (cherry picked from commit fa9b9cb) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
GH-118821 is a backport of this pull request to the 3.13 branch. |
GH-118822 is a backport of this pull request to the 3.12 branch. |
Looks like that classes with
__weakrefoffset__ == 0
does not need to add__weakref__
slot to existing super ones.dataclasses
: 3.12.3 regression withweakref_slot
#118033