-
-
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
Reusing variable previously defined with walrus operator triggers used-before-def error #14626
Labels
bug
mypy got something wrong
topic-pep-572
PEP 572 (walrus operator)
topic-possibly-undefined
possibly-undefined error code
Comments
Thanks for reporting! We will include the fix in the 1.0.1 release. |
JukkaL
pushed a commit
that referenced
this issue
Feb 8, 2023
Fixes #14626. I believe changing the way that we analyze call expression makes sense (first, we analyze the callee, then we analyze the arguments).
ilinum
added a commit
to ilinum/mypy
that referenced
this issue
Feb 8, 2023
Fixes python#14626. I believe changing the way that we analyze call expression makes sense (first, we analyze the callee, then we analyze the arguments).
ilinum
added a commit
to ilinum/mypy
that referenced
this issue
Feb 8, 2023
Fixes python#14626. I believe changing the way that we analyze call expression makes sense (first, we analyze the callee, then we analyze the arguments).
ilinum
added a commit
that referenced
this issue
Feb 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
mypy got something wrong
topic-pep-572
PEP 572 (walrus operator)
topic-possibly-undefined
possibly-undefined error code
To Reproduce
Expected Behavior
Should be no errors -- this code does not error using mypy v0.991 or prior, so this seems to be a new issue with v1.0.0.
Actual Behavior
error: Name "y" is used before definition [used-before-def]
Your Environment
The text was updated successfully, but these errors were encountered: