Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
hugovk merged 1 commit intopython:3.14frommiss-islington:backport-6859b95-3.14
Aug 12, 2025

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedAug 12, 2025
edited by bedevere-appbot
Loading

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 the
original 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

…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>
@hugovk

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@hugovk
Copy link
Member

!buildbot aarch64 Fedora Stable LTO . PGO

@bedevere-bot
Copy link

🤖 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:aarch64 Fedora Stable LTO . PGO

The builders matched are:

  • aarch64 Fedora Stable LTO + PGO PR

@hugovkhugovk merged commit4dda176 intopython:3.14Aug 12, 2025
52 checks passed
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull requestSep 9, 2025
…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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@ericvsmithericvsmithAwaiting requested review from ericvsmithericvsmith is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees

No one assigned

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@miss-islington@hugovk@bedevere-bot@JelleZijlstra@encukou

[8]ページ先頭

©2009-2025 Movatter.jp