On this page
  1. typing.AsyncIterable
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from typing import AsyncIterable
help(AsyncIterable)

Linked from

Related notes