basedpyright
basedpyright copied to clipboard
second type argument to `Generator` is unsafe
Description
Code sample in basedpyright playground
from collections.abc import Generator
from typing import reveal_type
def iter() -> Generator[None, int, None]:
reveal_type((yield)) # basedpyright: int, runtime: NoneType
for _ in iter():
...
i think it's more like: generators in for loops are not checked correctly