inspect.isawaitable(object)
Return true if the object can be used in await
expression.
Can also be used to distinguish generator-based coroutines from regular generators:
def gen(): yield @types.coroutine def gen_coro(): yield assert not isawaitable(gen()) assert isawaitable(gen_coro())
New in version 3.5.
Please login to continue.