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

Function isfunction

Lib/inspect.py:267–283  ·  view source on GitHub ↗

Return true if the object is a user-defined function. Function objects provide these attributes: __doc__ documentation string __name__ name with which this function was defined __qualname__ qualified name of this function __module__ name of

(object)

Source from the content-addressed store, hash-verified

265 return False
266
267def isfunction(object):
268 """Return true if the object is a user-defined function.
269
270 Function objects provide these attributes:
271 __doc__ documentation string
272 __name__ name with which this function was defined
273 __qualname__ qualified name of this function
274 __module__ name of the module the function was defined in or None
275 __code__ code object containing compiled function bytecode
276 __defaults__ tuple of any default values for arguments
277 __globals__ global namespace in which this function was defined
278 __annotations__ dict of parameter annotations
279 __kwdefaults__ dict of keyword only parameters with defaults
280 __dict__ namespace which is supporting arbitrary function attributes
281 __closure__ a tuple of cells or None
282 __type_params__ tuple of type parameters"""
283 return isinstance(object, types.FunctionType)
284
285def _has_code_flag(f, flag):
286 """Return true if ``f`` is a function (or a method or functools.partial

Callers 10

ismethoddescriptorFunction · 0.85
isdatadescriptorFunction · 0.85
_has_code_flagFunction · 0.85
isroutineFunction · 0.85
_finddocFunction · 0.85
getfileFunction · 0.85
findsourceFunction · 0.85
getclosurevarsFunction · 0.85
_signature_from_functionFunction · 0.85
_signature_from_callableFunction · 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…