MCPcopy Index your code
hub / github.com/RustPython/RustPython / _signature_is_builtin

Function _signature_is_builtin

Lib/inspect.py:2057–2068  ·  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

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

Callers 3

_signature_from_builtinFunction · 0.85
_signature_from_callableFunction · 0.85

Calls 3

isbuiltinFunction · 0.85
ismethoddescriptorFunction · 0.85
isinstanceFunction · 0.85

Tested by

no test coverage detected