pytype
pytype copied to clipboard
Generator[int] "expected 3 parameters, got 1" even though it is valid acc to Python docs
[invalid-annotation] Generator[_T, _T2, _V] expected 3 parameters, got 1
However, the Python documentation clearly says that the following is valid:
def infinite_stream(start: int) -> Generator[int]:
while True:
yield start
start += 1
https://docs.python.org/3/library/typing.html#annotating-generators-and-coroutines