-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
False positive: subclass method of overloaded function #15899
Comments
This is not a false positive. With the superclass signature, you're guaranteed to get an int back if you pass an int. With the subclass signature, you may get a str back instead. Therefore, the subclass signature is incompatible and mypy is right to show an error. |
@JelleZijlstra Is this what happens internally? (At least philosophically)
|
Correct. |
Ok, thanks! |
#14725 is a false positive, because there the subclass signature is compatible. |
Yeah, sorry misread it. Edited the comment. |
Bug Report
Mypy reports error when a subclass overwrites a overloaded method.
To Reproduce
Gist URL
Playground URL
Expected Behavior
This should be fine
Actual Behavior
Your Environment
(Probably) related issues:
The text was updated successfully, but these errors were encountered: