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

Function _is_async_obj

Lib/unittest/mock.py:57–62  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

55_safe_super = super
56
57def _is_async_obj(obj):
58 if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
59 return False
60 if hasattr(obj, '__func__'):
61 obj = getattr(obj, '__func__')
62 return iscoroutinefunction(obj) or inspect.isawaitable(obj)
63
64
65def _is_async_func(func):

Callers 2

__new__Method · 0.85
__enter__Method · 0.85

Calls 2

iscoroutinefunctionFunction · 0.90
_is_instance_mockFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…