-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Labels
bugmypy got something wrongmypy got something wrongpriority-2-lowtopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly
Description
Bug Report
runtime and mypy types don't match, possibly related to #6457
To Reproduce
from typing import Generator
def f() -> Generator[int, None, str]:
yield 1
return "lol"
def g() -> Generator[int, None, None]:
x = [(yield from f()) for lel in range(5)]
print(x) # <generator object g.<locals>.<listcomp> at 0x7fba92696a20>
reveal_type(x) # List[str]
g()
Expected Behavior
reveal_type
outputting Generator[something]
to match runtime
Actual Behavior
List[str]
Your Environment
- Mypy version used: 0.812
- Mypy command-line flags: none
- Mypy configuration options from
mypy.ini
(and other config files): none - Python version used: 3.7.3
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-2-lowtopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly