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
test.py:5: error: Incompatible types in assignment (expression has type "int", variable has type "str")
test.py:6: note: Revealed type is "builtins.str"
test.py:8: error: Incompatible types in assignment (expression has type "int", variable has type "str")
test.py:9: note: Revealed type is "builtins.str"
test.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "str")
test.py:13: note: Revealed type is "builtins.str"
test.py:15: error: Incompatible types in assignment (expression has type "int", variable has type "str")
test.py:16: note: Revealed type is "builtins.str"
or maybe statement-unreachable on lines 5 and 15?
Actual Behavior
test.py:8: error: Incompatible types in assignment (expression has type "int", variable has type "str")
test.py:9: note: Revealed type is "builtins.str"
test.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "str")
test.py:13: note: Revealed type is "builtins.str"
Your Environment
Mypy version used: 0.910
Mypy command-line flags: Just mypy test.py.
Mypy configuration options from mypy.ini (and other config files): None
Python version used: 3.8.3
Operating system and version: Windows 10 Pro 21H1
The text was updated successfully, but these errors were encountered:
Ah, I overlooked --warn-unreachable. I also see I'm far from the first one to submit a bug for this; looks like I wasn't using the right keywords XD. Apologies.
Is there any reason not to set --warn-unreachable with --strict?
If so, will the upcoming truthy-bool error be on by default or enabled with --strict?
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
If the condition of an
if
block is aCallable
(ornot Callable
), the body of theelse
(orif
) is not analyzed by mypy.To Reproduce
Run
mypy
on:Expected Behavior
Either:
or maybe
statement-unreachable
on lines 5 and 15?Actual Behavior
Your Environment
0.910
mypy test.py
.mypy.ini
(and other config files): None3.8.3
The text was updated successfully, but these errors were encountered: