- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Adds dataclass_transform
to dataclass
#4007
Conversation
@samuelcolvin |
I'll look soon, might be after pycon though. |
please review |
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.
LGTM
this needs to be rebased from msater to fix CI. |
* ✨ Adds dataclass_transform to dataclasses * ✨ Adds dataclass_transform to dataclasses Co-authored-by: Samuel Colvin <s@muelcolvin.com>
Change Summary
This PR continues #2721 by adding
__dataclass_transform__
decorator to the pydantic dataclass decorator so that pyright can infer the__init__
method as well as the instance attributes and types.For more info about this decorator make sure to check out #2721.
Related issue number
Fixes #4006
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)