-
-
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
Inheriting overloaded signatures #5146
Comments
Currently yes, you are supposed to repeat type signature in subclasses even if it is unchanged, otherwise all unannotated functions are not checked and all their args are given |
Given that python/typing#269 was closed by saying that this should be a type checker specific decision does this mean that mypy has decided not to implement this feature or could this issue be reopened for discussion? |
Say we have a class
Foo
:If we now add a subclass
Bar
like this:and run mypy on it without any flags, we get the expected
error: No overload variant of "fun" of "Bar" matches argument type "List[<nothing>]"
.If however we don't copy the overloaded signatures,
then mypy does not find any errors. Is this inteded behaviour? Is it not possible to find the overloaded signatures of the base classes statically? Am I not supposed to do this sort of thing in the first place?
The text was updated successfully, but these errors were encountered: