Do not error on fields overridden by methods in the mypy plugin#12290
Do not error on fields overridden by methods in the mypy plugin#12290
Conversation
Deploying pydantic-docs with
|
| Latest commit: |
1b4dde9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://58a39027.pydantic-docs.pages.dev |
| Branch Preview URL: | https://mypy-plugin-frozen-overridde.pydantic-docs.pages.dev |
| parent_attr: str = Field(exclude=True) | ||
|
|
||
|
|
||
| # We don't wan't to froze `parent_attr` in the plugin: |
There was a problem hiding this comment.
Why not? also typo should be "freeze"
There was a problem hiding this comment.
See the fixed issue, it results in unexpected errors.
There was a problem hiding this comment.
I see, maybe this is clearer:
| # We don't wan't to froze `parent_attr` in the plugin: | |
| # `parent_attr` is writable, mypy should error when overriding with a read-only property |
|
|
||
|
|
||
| # We don't wan't to froze `parent_attr` in the plugin: | ||
| class Chield(Parent): |
There was a problem hiding this comment.
| class Chield(Parent): | |
| class Child(Parent): |
There was a problem hiding this comment.
Doesn't look like this suggestion was applied?
There was a problem hiding this comment.
Hum I don't see it on the diff?
CodSpeed Performance ReportMerging #12290 will improve performances by 5.19%Comparing Summary
Benchmarks breakdown
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
5217563 to
feb23f9
Compare
feb23f9 to
5a3337d
Compare
davidhewitt
left a comment
There was a problem hiding this comment.
I see, I understand now
| parent_attr: str = Field(exclude=True) | ||
|
|
||
|
|
||
| # We don't wan't to froze `parent_attr` in the plugin: |
There was a problem hiding this comment.
I see, maybe this is clearer:
| # We don't wan't to froze `parent_attr` in the plugin: | |
| # `parent_attr` is writable, mypy should error when overriding with a read-only property |
|
|
||
|
|
||
| # We don't wan't to froze `parent_attr` in the plugin: | ||
| class Chield(Parent): |
There was a problem hiding this comment.
Doesn't look like this suggestion was applied?
Change Summary
Also update mypy to 1.18 and update tests.
Fixes #12278.
Related issue number
Checklist