New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyre doesn't understand for-else statement #791
Comments
Hey @WangGithubUser, thanks for reporting this! I didn't know that for-else loops were a thing until now, it's a cool feature of the language! As a quick debugging check, I tried doing a similar setup with an |
The error you're seeing is because Pyre isn't sure if the variable my_none is always set before it's used. To fix this error i would suggest you to initialize my_none before the loop: from random import randint def foo() -> None:
|
Pyre Bug
Bug description
Pyre doesn't understand meaning of for-else.
Reproduction steps
Run pyre-check with following script:
Expected behavior
This should pass but not give a false positive:
test.py:9:11 Uninitialized local [61]: Local variable `my_none` is undefined, or not always defined.
Logs
pyre_rage.log
The text was updated successfully, but these errors were encountered: