-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 W0231 when using typing.overload. #3020
Comments
Thanks, this definitely makes sense. |
I can try and take a look |
def __init__(self, num: Union[int, float]):
super().__init__(round(num)) I think you don't need to put type annotations here, it was the sole purpose of overload methods to do that. |
@gyermolenko However, none of these changes prevent the original warnings from pylint. |
Well, to fix the issue I've created PR :) |
@gyermolenko |
Steps to reproduce
Minimum failing example.
Run pylint on the above example code.
Current behavior
Expected behavior
The methods decorated with
typing.overload
should not be required to call the base__init__
as they are "for the benefit of the type checker only" as indicated at https://docs.python.org/3/library/typing.html#typing.overload.pylint --version output
Same bug exists on the master branch which includes #2927.
The text was updated successfully, but these errors were encountered: