mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #27243: Fix __aiter__ protocol
This commit is contained in:
parent
ebe95fdabb
commit
a6f6edbda8
13 changed files with 292 additions and 33 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue