-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Augmented assignment leads to type complaints #2098
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
Comments
Wow. Good catch. Seems there's something strange going on indeed! We'll
investigate.
|
The error is not directly related to augmented assignment, I think. Mypy assumes that the second assignment kills the first
Just like any other case of compatible assignment. So how is that different from the simpler case
Allowing the latter (inferring float without any other hint) can easily miss real type errors. |
If that's the cause, why then is
considered correct? |
I think that because In other words, |
It seems that
|
Indeed from a 'user' point of view, the disparity between simple assignment and augmented assignment is hard to comprehend. At least for me it was... So if it could be avoided I think it would be an improvement. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I am using mypy 0.4.4. It seems augmented assignments aren't yet dealt with correctly.
The text was updated successfully, but these errors were encountered: