On this page
typing.AsyncIterable
Prev: typing.AsyncGenerator | Up: typing | Next: typing.AsyncIterator
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.AsyncIterable
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import AsyncIterable
Signature & Overview
typing.AsyncIterable(*args, **kwargs)
Deprecated alias to collections.abc.AsyncIterable.
Usage
from typing import AsyncIterable
async def collect(stream: AsyncIterable[int]) -> list[int]:
return [x async for x in stream]
assert callable(collect)
Gotchas
- Prefer
collections.abc.AsyncIterable[T]in Python 3.9+: Represents any object usable withasync for.
REPL Inspect
from typing import AsyncIterable
help(AsyncIterable)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/AsyncGenerator Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncIterator Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/typing/AbstractSet Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Annotated Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Any Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_never Linked here; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/assert_type shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/AsyncContextManager shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Awaitable shared tags: #stdlib, #typing