You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
waleedmebane
changed the title
"Name not defined" error should be reported when variable is declared with a type annotation but not assigned to before use
False negative: "Name not defined" error should be reported when variable is declared with a type annotation but not assigned to before use
Oct 15, 2021
Bug Report
Mypy does not report an error for the code above or for this code:
But reports:
error: Name "x" is not defined
for:
At runtime Python reports:
NameError: name 'x' is not defined
in all three cases.
Expected Behavior
Mypy should report
Name "x" is not defined
in all three cases.Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: