-
-
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
useless-super-delegation when an override changes the return type annotation #5822
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Milestone
Comments
Infernio
added
the
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
label
Feb 20, 2022
DanielNoord
added
False Positive 🦟
A message is emitted but nothing is wrong with the code
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Feb 21, 2022
I experience the same error, except that the superclass is an ABC. I would consider this a bug seeing as this behaviour contradicts what is in the changelog for 2.0 |
timmartin
added a commit
to timmartin/pylint
that referenced
this issue
Apr 2, 2022
timmartin
added a commit
to timmartin/pylint
that referenced
this issue
Apr 3, 2022
4 tasks
timmartin
added a commit
to timmartin/pylint
that referenced
this issue
Apr 14, 2022
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Apr 15, 2022
…6141) * Reinstate warning if base method has no return type annotation
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Apr 20, 2022
…6141) * Reinstate warning if base method has no return type annotation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current problem
Similar to #1923, but for the return type annotation.
It is sometimes useful to override a method and change the return type annotation - whether to help a static type checker out or to help the IDE make better autocomplete suggestions.
Here's an example - it's a bit contrived, I actually ran into this when overriding to add typing to a method from a third-party library (ANTLR).
Running pylint with default config on it:
Desired solution
pylint should not emit a warning in this case as the override has legitimate uses.
Additional context
No response
The text was updated successfully, but these errors were encountered: