In mypy AsyncIterable has an __anext__ method, but it should not: it should have __aiter__ only, but that is missing.
The code here:
|
class AsyncIterable(Generic[_T_co]): |
|
@abstractmethod |
|
def __anext__(self) -> Awaitable[_T_co]: ... |
|
|
|
class AsyncIterator(AsyncIterable[_T_co], |
|
Generic[_T_co]): |
|
@abstractmethod |
|
def __anext__(self) -> Awaitable[_T_co]: ... |
|
def __aiter__(self) -> 'AsyncIterator[_T_co]': ... |
Should be:
class AsyncIterable(Generic[_T_co]):
@abstractmethod
def __aiter__(self) -> 'AsyncIterator[_T_co]': ...
class AsyncIterator(AsyncIterable[_T_co],
Generic[_T_co]):
@abstractmethod
def __anext__(self) -> Awaitable[_T_co]: ...
def __aiter__(self) -> 'AsyncIterator[_T_co]': ...
I will try to figure out how to contribute a patch and tests :-)
In mypy AsyncIterable has an
__anext__method, but it should not: it should have__aiter__only, but that is missing.The code here:
typeshed/stdlib/3/typing.pyi
Lines 156 to 164 in 0709985
Should be:
I will try to figure out how to contribute a patch and tests :-)