Collection Interface ABCs

collections.abc.Awaitable

Objects supporting __await__. Generator-based coroutines can be awaitable without passing this ABC test.

Formal Syntax & Structure

python syntaxpython
collections.abc.Awaitable

Return Value

type

Abstract base class object representing the described interface; use it for recognition or inheritance.

Working Example

Example Snippetpython
import collections.abcimport inspectasync def f(): return 1c=f()try: result=isinstance(c,collections.abc.Awaitable)finally: c.close()print(result)
Python Reference