Skip to content

bpo-45897: Fix frozen-slotted dataclass bug - #29895

Closed
AlexWaygood wants to merge 16 commits into
python:mainfrom
AlexWaygood:dataclass-slots
Closed

AlexWaygood wants to merge 16 commits into
python:mainfrom
AlexWaygood:dataclass-slots

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Dec 2, 2021 •

Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood added the type-bug An unexpected behavior, bug, or error label Dec 6, 2021
Comment thread Lib/test/test_dataclasses.py Outdated
Comment thread Lib/test/test_dataclasses.py Outdated
Comment thread Lib/test/test_dataclasses.py Outdated
Comment thread Lib/test/test_dataclasses.py Outdated
Comment thread Lib/test/test_dataclasses.py Outdated
AlexWaygood and others added 3 commits December 16, 2021 22:37
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Comment thread Lib/test/test_dataclasses.py Outdated
Comment thread Lib/dataclasses.py
@AlexWaygood
AlexWaygood marked this pull request as draft January 24, 2022 07:48
@AlexWaygood
AlexWaygood marked this pull request as ready for review January 24, 2022 19:20

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but will leave to @ericvsmith to merge.

Comment thread Lib/dataclasses.py
# Frozen __setattr__/__delattr__ must be added after __slots__
# bpo-45897
if frozen:
for fn in _frozen_get_del_attr(cls, field_list, globals):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function ought to be named _frozen_set_del_attr. That's outside the scope of this PR though.

@JelleZijlstra

Copy link
Copy Markdown
Member

@ericvsmith could you take a look at this PR?

@ericvsmith

Copy link
Copy Markdown
Member

Thanks for the reminder. This is one of the things I'll be reviewing at PyCon.

@AlexWaygood

AlexWaygood commented May 3, 2022 •

Copy link
Copy Markdown
Member Author

Closing and reopening to retrigger CI, since test_concurrent_futures has been running for 2hr43 and counting on Windows (x86) -- I've opened #92222 since this appears to have happened 3 times in 3 days in our CI.

@AlexWaygood

Copy link
Copy Markdown
Member Author

@ericvsmith, any thoughts on this PR? Happy to revise or close if you don't like the approach :)

@ericvsmith

Copy link
Copy Markdown
Member

Sorry it’s taken me so long to look at this, @AlexWaygood. I’ve been super-busy, with no signs of improving. If you don’t hear from me in a two weeks or so, please ping me again.

@AlexWaygood

Copy link
Copy Markdown
Member Author

Sorry it’s taken me so long to look at this, @AlexWaygood. I’ve been super-busy, with no signs of improving. If you don’t hear from me in a two weeks or so, please ping me again.

Thanks for letting me know @ericvsmith, no worries.

@AlexWaygood

Copy link
Copy Markdown
Member Author

Sorry it’s taken me so long to look at this, @AlexWaygood. I’ve been super-busy, with no signs of improving. If you don’t hear from me in a two weeks or so, please ping me again.

Ping, @ericvsmith :)

@AlexWaygood

Copy link
Copy Markdown
Member Author

Closing as per @ericvsmith's rationale in #90055 (comment)

@AlexWaygood AlexWaygood closed this Oct 4, 2022
@AlexWaygood
AlexWaygood deleted the dataclass-slots branch October 4, 2022 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.11 only security fixes type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants