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

typing.AsyncIterator

Prev: typing.AsyncIterable | Up: typing | Next: typing.Awaitable
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.AsyncIterator
Tags: #public #python3 #stdlib #typing


Import

import typing
from typing import AsyncIterator

Signature & Overview

typing.AsyncIterator(*args, **kwargs)

Deprecated alias to collections.abc.AsyncIterator.

Usage

from typing import AsyncIterator

async def take_first(it: AsyncIterator[str]) -> str:
    return await it.__anext__()

assert callable(take_first)

Gotchas

REPL Inspect

from typing import AsyncIterator
help(AsyncIterator)

Linked from

Related notes