ID EN
Types

coroutine

Python 3.11

This function transforms a generator function into a coroutine function which returns a generator-based coroutine. The generator-based coroutine is still a generator iterator, but is also considered to be a coroutine object and is awaitable. However, it may not necessarily implement the __await__() method.

Syntax

PYTHON
types.coroutine(gen_func)

See Also

generator coroutine function generator iterator coroutine awaitable __await__() collections.abc.Generator