On this page
typing.Awaitable
Prev: typing.AsyncIterator | Up: typing | Next: typing.BinaryIO
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.Awaitable
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import Awaitable
Signature & Overview
typing.Awaitable(*args, **kwargs)
Deprecated alias to collections.abc.Awaitable.
Usage
from typing import Awaitable
async def run_it(job: Awaitable[int]) -> int:
return await job
assert callable(run_it)
Gotchas
- Prefer
collections.abc.Awaitable[T]in Python 3.9+: Accepts coroutines,asyncio.Task,asyncio.Future, or any object implementing__await__.
REPL Inspect
from typing import Awaitable
help(Awaitable)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/AsyncIterator Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/BinaryIO 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/AsyncGenerator shared tags: #stdlib, #typing