-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Better error message for assignments and returns incompatible due to invariance #6803
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
Better error message for assignments and returns incompatible due to invariance #6803
Conversation
…ers struggles. After clone the project I was not able to find the folder for typeshed because I was looking for it at the mypy repo folder but actually there is a second folder also called mypy where the typeshed folder will be, the right path is 'mypy/mypy/typeshed'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! The general idea looks right, here I have few comments.
fb4edbd
to
95a86e0
Compare
Also please don't force push, it makes reviewing harder, just add more commits to the branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for updates! I think this is now ready to be merged.
The tests are failing probably because I'm checking the
INCOMPATIBLE_TYPES_IN_ASSIGNMENT
not at the right part of this method.I also not sure if the type expected by
append_invariance_notes
that I am passing to it, thesubtype
and thesupertype
because the test that I created work but it do not work for several other tests.Most of the error are something like:
AttributeError: 'TypeType' object has no attribute 'type'
Can someone help me with it?
Here are two examples:
Fixes: #4186