-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 incompatible type assignment when using Generics #8934
Comments
I do think the diagnostic could be better. Perhaps something like:
|
Hi, I'm new to open source contribution. Could I try to solve this issue with the message @ethanhs mentioned? |
@sanlf Welcome! I think the specifics of the output of the diagnostic need more discussion. I would recommend maybe trying to tackle another issue. |
@ethanhs Understood. I will try to find another good-first-issue. |
@eternal861 How about something more conversational?
Would expand to
Disclaimer: I'm new to the codebase/conventions used in mypy but looking to contribute where I can |
@eternal861 Sir, i would like to suggest |
can you tell the exact file location to be modified? |
Interested in working on this issue. @ethanhs can you please assign me to this issue. |
Hi, I'd like to tackle this issue. I am still new to the whereabouts of different scripts in the repository, but I guess the error message can be modified in the |
Feature Request
mypy throws this error:
This error message is thrown because of the combination of assigning a different type to
x
and usingGeneric
. The error message is unclear because it indicates a type error on the argument passed tobar
and can be interpreted asbar
not accepting arguments of type float.Having a different error message that mentions "Incompatible types in assignment" would be clearer.
A message to make it clearer that
expression has type Foo[float], variable has type Foo[int]
mypy 0.770 and Python 3.7.6
None
The text was updated successfully, but these errors were encountered: