On this page
typing.Coroutine
Prev: typing.ContextManager | Up: typing | Next: typing.Counter
Rel: typing.AbstractSet, typing.Annotated, typing.Any, typing.assert_never
Ref: docs.python.org — typing.Coroutine
Tags: #public #python3 #stdlib #typing
Import
import typing
from typing import Coroutine
Signature & Overview
typing.Coroutine(*args, **kwargs)
Deprecated alias to collections.abc.Coroutine.
Usage
from typing import Coroutine
# Type parameters are [YieldType, SendType, ReturnType]
assert Coroutine[None, None, int] is not None
Gotchas
- Prefer
collections.abc.Coroutine[Any, Any, T](orAwaitable[T]): Note thatReturnTypeis the third parameter, not the first.
REPL Inspect
from typing import Coroutine
help(Coroutine)
Linked from
Related notes
- tuts/python3/stdlib_module/typing/ContextManager Linked here; links to this page; shared tags: #stdlib, #typing
- tuts/python3/stdlib_module/typing/Counter 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