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

Function _signature_is_builtin

Lib/inspect.py:2064–2075  ·  view source on GitHub ↗

Private helper to test if `obj` is a callable that might support Argument Clinic's __text_signature__ protocol.

(obj)

Source from the content-addressed store, hash-verified

2062
2063
2064def _signature_is_builtin(obj):
2065 """Private helper to test if `obj` is a callable that might
2066 support Argument Clinic's __text_signature__ protocol.
2067 """
2068 return (isbuiltin(obj) or
2069 ismethoddescriptor(obj) or
2070 isinstance(obj, _NonUserDefinedCallables) or
2071 # Can't test 'isinstance(type)' here, as it would
2072 # also be True for regular python classes.
2073 # Can't use the `in` operator here, as it would
2074 # invoke the custom __eq__ method.
2075 obj is type or obj is object)
2076
2077
2078def _signature_is_functionlike(obj):

Callers 3

_signature_from_builtinFunction · 0.85
_signature_from_callableFunction · 0.85

Calls 2

isbuiltinFunction · 0.85
ismethoddescriptorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…