error: Right operand of "or" is never evaluated - although it is evaluated at some point #14120
Labels
bug
mypy got something wrong
topic-inference
When to infer types or require explicit annotations
topic-reachability
Detecting unreachable code
topic-strict-optional
Bug Report
Mypy is giving out
error: Right operand of "or" is never evaluated
on a statement that is evaluated. It is part of a for loop and it is not evaluated on the first pass of the loop, however it is evaluated on each consecutive pass of the for loop.I understand why the right side is not evaluated on the first pass, but I feel that it should not error out on this code as it is evaluated at some point. Or at least the error message should be different.
To Reproduce
Playground link
This is simplified example of the code I'm seeing this error in.
Expected Behavior
Success.
Actual Behavior
Found 1 error in 1 file (checked 1 source file)
Your Environment
mypy 0.982 (compiled: yes)
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: