Search notes:

Python: types.coroutine

types.coroutine(fn) converts regular generator functions to coroutines and thus allows interoperability between existing generator-based coroutines in asyncio and *native coroutines introduced by PEP 492.
callable(fn) must return True.
If fn is a generator function, the function applies the CO_ITERABLE_COROUTINE flag to fn which makes it a coroutine object.
Otherwise, it will be wrapped.

Index