We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
return
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
A platform check that is working fine in if and else is not working after if ... return.
if
else
if ... return
To Reproduce
import sys def works() -> None: if sys.platform != "win32": return else: from winreg import REG_SZ def fails() -> None: if sys.platform != "win32": return from winreg import REG_SZ
https://mypy-play.net/?mypy=latest&python=3.11&gist=eddad091a6082bd85c5c7524839726b1
Expected Behavior
No error.
Actual Behavior
main.py:12: error: Module "winreg" has no attribute "REG_SZ" [attr-defined] Found 1 error in 1 file (checked 1 source file)
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
A platform check that is working fine in
if
andelse
is not working afterif ... return
.To Reproduce
https://mypy-play.net/?mypy=latest&python=3.11&gist=eddad091a6082bd85c5c7524839726b1
Expected Behavior
No error.
Actual Behavior
main.py:12: error: Module "winreg" has no attribute "REG_SZ" [attr-defined]
Found 1 error in 1 file (checked 1 source file)
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: