Skip to content
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

Dataclasses should define __replace__ in 3.13 #17471

Closed
max-muoto opened this issue Jul 3, 2024 · 0 comments · Fixed by #17469
Closed

Dataclasses should define __replace__ in 3.13 #17471

max-muoto opened this issue Jul 3, 2024 · 0 comments · Fixed by #17469
Labels

Comments

@max-muoto
Copy link
Contributor

max-muoto commented Jul 3, 2024

Feature

Add __replace__ on dataclasses in 3.13+.

Pitch

Similar to how we're special casing support for __replace__ on namedtuple, we should do the same for dataclasses.

This is causing some false positive issues in TypeShed, where __replace__ isn't getting registered on dataclasses (FunctionProfile and StatsProfile) and is needed to properly support the protocol for copy.replace: python/typeshed#12262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant