changed the title [-]false unreachable with conditional reassignment then continue in loop[/-][+](🐞) false unreachable with conditional reassignment then continue in loop[/+]on Oct 31, 2023
changed the title [-](🐞) false unreachable with conditional reassignment then continue in loop[/-][+](🐞) false unreachable with reassignment in loop[/+]on Oct 31, 2023
Activity
sobolevn commented on Dec 6, 2021
This can be fixed by:
The other question is: why a is not infered to be None | int?
KotlinIsland commented on Dec 6, 2021
It is, if you put reveal_type after the loop it reveals as int | None
Perhaps it is inferring as int | None, but only past line 4, not considering the loop.
KotlinIsland commented on Oct 31, 2023
@sobolevn It's not just the inference, I've updated the OP with a much better example.
Avoid false `unreachable` and `redundant-expr` warnings in loops.
Avoid false `unreachable` and `redundant-expr` warnings in loops. (py…