False positive with --warn-unreachable when an instance variable is modified inside a for loop #13973
Labels
bug
mypy got something wrong
topic-reachability
Detecting unreachable code
topic-type-narrowing
Conditional type narrowing / binder
Bug Report
mypy mark as unreachable code that is perfectly reachable, perhaps because it interprets an instance variable typed as Optional to always be None.
To Reproduce
Gist
Playground URL
Expected Behavior
No errors.
Actual Behavior
Showing:
error: Statement is unreachable [unreachable]
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: