Перейти к содержанию

Python aiter() built-in function

Python aiter() built-in function

From the Python 3 documentation Return an asynchronous iterator for an asynchronous iterable. Equivalent to calling x.aiter(). aiter() is an async equivalent of iter()

Example

>>> async def aitersync(iterable):
...    results = []
...    async for x in aiter(iterable):
...        results.append(x)
...    return iter(results)