We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report (Maybe related to #8766)
Consider the following code:
from typing import Iterator def gen() -> Iterator[int]: if 1 == 2: yield 0 def test() -> None: x = None for x in gen(): pass if x is None: print('reachable')
To Reproduce
mypy above_file.py --warn-unreachable
Expected Behavior No error.
Actual Behavior
tmp.py:14: error: Statement is unreachable print('reachable') ^ Found 1 error in 1 file (checked 1 source file)
Your Environment
The text was updated successfully, but these errors were encountered:
I think there's an existing issue for this: the problem is essentially that mypy thinks for loops always execute at least once.
Sorry, something went wrong.
I think there's an existing issue for this
#8637?
Yes, thanks!
Thanks both!
No branches or pull requests
Bug Report
(Maybe related to #8766)
Consider the following code:
To Reproduce
Expected Behavior
No error.
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered: