Skip to content

gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible #136893

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jul 20, 2025

An interesting hack, but more localized in scope than #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.

…ke the original class collectible

An interesting hack, but more localized in scope than python#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant