PyDocs

Nav

Python Runtime Services

iscoroutinefunction

inspect

function · Added in 3.5 (source)
  • iscoroutinefunction(object)
Return true if the object is a coroutine function.

Coroutine functions are normally defined with "async def" syntax, but may
be marked via markcoroutinefunction.
Changed in 3.8, 3.10.6, 3.12, 3.13
  • 3.8: Functions wrapped in functools.partial() now return True if the wrapped function is a coroutine function.
  • 3.10.6: Duck-typed function-like objects now return True if their code object has the CO_COROUTINE flag.
  • 3.12: Sync functions marked with markcoroutinefunction() now return True.
  • 3.13: Functions wrapped in functools.partialmethod() now return True if the wrapped function is a coroutine function.
0 Examples
No examples for inspect/iscoroutinefunction.
See Also
No see-alsos for inspect/iscoroutinefunction
0 Notes
No notes for iscoroutinefunction