Issue #27243: Fix __aiter__ protocol

This commit is contained in:
Yury Selivanov 2016-06-09 15:08:31 -04:00
parent ebe95fdabb
commit a6f6edbda8
13 changed files with 292 additions and 33 deletions

View file

@ -156,7 +156,7 @@ class AsyncIterable(metaclass=ABCMeta):
__slots__ = ()
@abstractmethod
async def __aiter__(self):
def __aiter__(self):
return AsyncIterator()
@classmethod
@ -176,7 +176,7 @@ class AsyncIterator(AsyncIterable):
"""Return the next item or raise StopAsyncIteration when exhausted."""
raise StopAsyncIteration
async def __aiter__(self):
def __aiter__(self):
return self
@classmethod