MCPcopy Create free account
hub / github.com/numpy/numpy / getargspec

Function getargspec

numpy/_utils/_inspect.py:96–111  ·  view source on GitHub ↗

Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' i

(func)

Source from the content-addressed store, hash-verified

94 return args, varargs, varkw
95
96def getargspec(func):
97 """Get the names and default values of a function's arguments.
98
99 A tuple of four things is returned: (args, varargs, varkw, defaults).
100 'args' is a list of the argument names (it may contain nested lists).
101 'varargs' and 'varkw' are the names of the * and ** arguments or None.
102 'defaults' is an n-tuple of the default values of the last n arguments.
103
104 """
105
106 if ismethod(func):
107 func = func.__func__
108 if not isfunction(func):
109 raise TypeError('arg is not a Python function')
110 args, varargs, varkw = getargs(func.__code__)
111 return args, varargs, varkw, func.__defaults__
112
113def getargvalues(frame):
114 """Get information about arguments passed into a particular frame.

Callers 2

get_object_signatureFunction · 0.85

Calls 3

ismethodFunction · 0.85
isfunctionFunction · 0.70
getargsFunction · 0.70

Tested by

no test coverage detected