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
More generally, the type of the while subject does not get updated from the body:
b=Nonereveal_type(b) # None from ? | Nonewhilenotb:
reveal_type(b) # None from ? | Noneb=1reveal_type(b) # int from int | Nonereveal_type(b) # unreachable
Bug Report
A
while
loop in a function prevents mypy to detect a missing return statement.To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&flags=strict&gist=363627f969a9a127616dd5ee7ea2a235
Expected Behavior
In strict mode, mypy should raise an error because
f
doesn't returnActual Behavior
Mypy successes!
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: