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

Function iscoroutine

Lib/asyncio/coroutines.py:41–54  ·  view source on GitHub ↗

Return True if obj is a coroutine object.

(obj)

Source from the content-addressed store, hash-verified

39
40
41def iscoroutine(obj):
42 """Return True if obj is a coroutine object."""
43 if type(obj) in _iscoroutine_typecache:
44 return True
45
46 if isinstance(obj, _COROUTINE_TYPES):
47 # Just in case we don't want to cache more than 100
48 # positive types. That shouldn't ever happen, unless
49 # someone stressing the system on purpose.
50 if len(_iscoroutine_typecache) < 100:
51 _iscoroutine_typecache.add(type(obj))
52 return True
53 else:
54 return False
55
56
57def _format_coroutine(coro):

Callers 1

_format_coroutineFunction · 0.70

Calls 1

addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…