On this page
aiter
Prev: abs | Up: __builtins__ | Next: all
Rel: all, any, enumerate, filter, iter
Ref: docs.python.org — aiter
Tags: #public #python3 #builtins
Import & Availability
# Built-in (available globally without import)
from builtins import aiter
Overview & Signature
aiter(async_iterable, /)
Return an AsyncIterator for an AsyncIterable object.
Usage
import asyncio
async def stream():
yield "first"
yield "second"
async def main():
it = aiter(stream())
assert await anext(it) == "first"
asyncio.run(main())
Gotchas
- Requires Python 3.10+: Async counterpart to
iter(), invokingobj.__aiter__().
REPL Inspect
help(aiter)
Linked from
Related notes
- tuts/python3/__builtins__/__builtins__ Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/abs Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/all Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/any Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/enumerate Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/filter Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/iter Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__ links to this page; shared tags: #builtins
- tuts/c/builtins shared tags: #builtins
- tuts/c/builtins/__FILE__ shared tags: #builtins