-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 that inherit from other dataclasses fail type-checking when explicit-override
is enabled
#16452
Labels
Comments
cc. @ikonst |
Same problem here |
Ah, gross! This is actually a private variable, maybe the right thing to do is to exempt it from |
Oh, it looks like I just did that in #16464 (and even more) |
ilevkivskyi
added a commit
that referenced
this issue
Nov 12, 2023
Fixes #9910 Fixes #16452 We already exclude private names from override type compatibility checks etc., but it looks like some override checks were still performed, we need to skip them, since private name is actually a different name in subclass. --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
JukkaL
pushed a commit
that referenced
this issue
Nov 22, 2023
Fixes #9910 Fixes #16452 We already exclude private names from override type compatibility checks etc., but it looks like some override checks were still performed, we need to skip them, since private name is actually a different name in subclass. --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Dataclasses that inherit from other dataclasses fail type-checking when
explicit-override
is enabled. This appears to be due to an unannotated override being constructed for the new & improvedreplace
typing.To Reproduce
Actual Behavior
mypy errors on
Child
withMethod "__mypy-replace" is not using @override but is overriding a method in class "Base" [explicit-override]
Your Environment
pyproject.toml
:The text was updated successfully, but these errors were encountered: