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

Function get_name

Lib/asyncio/coroutines.py:60–72  ·  view source on GitHub ↗
(coro)

Source from the content-addressed store, hash-verified

58 assert iscoroutine(coro)
59
60 def get_name(coro):
61 # Coroutines compiled with Cython sometimes don't have
62 # proper __qualname__ or __name__. While that is a bug
63 # in Cython, asyncio shouldn't crash with an AttributeError
64 # in its __repr__ functions.
65 if hasattr(coro, '__qualname__') and coro.__qualname__:
66 coro_name = coro.__qualname__
67 elif hasattr(coro, '__name__') and coro.__name__:
68 coro_name = coro.__name__
69 else:
70 # Stop masking Cython bugs, expose them in a friendly way.
71 coro_name = f'<{type(coro).__name__} without __name__>'
72 return f'{coro_name}()'
73
74 def is_running(coro):
75 try:

Callers 2

_get_name_infoFunction · 0.85
_format_coroutineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…