-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly
Description
mypy seems to be too thorough when interpreting if sys.platform == ... conditions. Consider the following file:
import sys
from typing import Generator
def f() -> Generator[int, None, None]:
if sys.platform == "darwin":
yield 1I'm trying to run mypy for this file on Linux using mypy gen.py
Expected behavior:
mypy test passes for this file on Linux
Actual behavior:
I get this on Linux:
$ mypy gen.py
gen.py:4: error: Missing return statement
At the same time, mypy on macOS does not complain. I think that this is related to #698
Platform information:
$ uname -sr; mypy --version; python --version
Linux 4.15.0-34-generic
mypy 0.630
Python 2.7.15rc1
Hnasar
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly