-
-
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
Provide more context about why incompatible with supertype is an error #5705
Comments
@JukkaL I would be happy to take a stab at this if I get a couple extra cycles soon, if were a little more clear exactly what we want here. What should the notes be exactly? Or should I just wing it? |
Hey @ckarnell are you still working on it? |
Here's a proposal for the notes that could be added:
|
Hi, just want to drop a note that I haven't gotten a chance to work on this. |
Hi, if no one's working on it, maybe I can? |
Yeah, feel free to take a shot. Probably the messages are in mypy/messages.py, yeah. It is possible that you'll need to gather more information from the call sites (probably in |
Added notes as suggested in the issue description after error from incompatible arguments in subtype is raised.
I made a PR with the notes suggested here |
Users often don't realize that overriding a method with an incompatible signature is unsafe from a type checking perspective; see #1237 for an example. We could generate some more descriptive notes with the error message, perhaps with a link to mypy documentation what contains a detailed discussion of Liskov Substitution Principle. We could also discuss how to work around the issue.
#5704 and #5025 are related issues.
The text was updated successfully, but these errors were encountered: