MCPcopy Index your code
hub / github.com/python/cpython / iscoroutinefunction

Function iscoroutinefunction

Lib/inspect.py:323–329  ·  view source on GitHub ↗

Return true if the object is a coroutine function. Coroutine functions are normally defined with "async def" syntax, but may be marked via markcoroutinefunction.

(obj)

Source from the content-addressed store, hash-verified

321 return func
322
323def iscoroutinefunction(obj):
324 """Return true if the object is a coroutine function.
325
326 Coroutine functions are normally defined with "async def" syntax, but may
327 be marked via markcoroutinefunction.
328 """
329 return _has_code_flag(obj, CO_COROUTINE) or _has_coroutine_mark(obj)
330
331def isasyncgenfunction(obj):
332 """Return true if the object is an asynchronous generator function.

Callers 7

_is_async_objFunction · 0.90
_is_async_funcFunction · 0.90
_mock_add_specMethod · 0.90
_execute_mock_callMethod · 0.90
create_autospecFunction · 0.90

Calls 2

_has_code_flagFunction · 0.85
_has_coroutine_markFunction · 0.85

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…