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

Function _get_function_source

Lib/asyncio/format_helpers.py:10–19  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

8
9
10def _get_function_source(func):
11 func = inspect.unwrap(func)
12 if inspect.isfunction(func):
13 code = func.__code__
14 return (code.co_filename, code.co_firstlineno)
15 if isinstance(func, functools.partial):
16 return _get_function_source(func.func)
17 if isinstance(func, functools.partialmethod):
18 return _get_function_source(func.func)
19 return None
20
21
22def _format_callback_source(func, args, *, debug=False):

Callers 1

_format_callback_sourceFunction · 0.85

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…