Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
HideBaseModel.__replace__
definition from type checkers#10979
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Because we make use of `@dataclass_transform()`, the method issynthesized by type checkers already. This fixes an issue withmypy and the Pydantic plugin, as the plugin removes the`dataclass_transform` spec from `BaseModel` subclasses,but not for `RootModel` that uses a different metaclass.
CodSpeed Performance ReportMerging#10979 willnot alter performanceComparing Summary
|
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
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.
Thanks@Viicos :)
4fffffe
intomainUh oh!
There was an error while loading.Please reload this page.
Because we make use of `@dataclass_transform()`, the method is synthesized by type checkers already. This fixes an issue with mypy and the Pydantic plugin, as the plugin removes the `dataclass_transform` spec from `BaseModel` subclasses, but not for `RootModel` which uses a different metaclass, and led to override issues with the synthesized `__replace__` for root models and the `BaseModel.__replace__` definition.
Uh oh!
There was an error while loading.Please reload this page.
Fixes#10970.
Because we make use of
@dataclass_transform()
, the method is synthesized by type checkers already. This fixes an issue with mypy and the Pydantic plugin, as the plugin removes thedataclass_transform
spec fromBaseModel
subclasses, but not forRootModel
which uses a different metaclass, and led to override issues with the synthesized__replace__
for root models and theBaseModel.__replace__
definition.Change Summary
Related issue number
Checklist