Return True if the object can be used in await expression.
inspect.isawaitable(object)
import types def gen(): yield @types.coroutine def gen_coro(): yield assert not isawaitable(gen()) assert isawaitable(gen_coro())