MCPcopy
hub / github.com/django/django / get_func_full_args

Function get_func_full_args

django/utils/inspect.py:47–68  ·  view source on GitHub ↗

Return a list of (argument name, default value) tuples. If the argument does not have a default value, omit it in the tuple. Arguments such as *args and **kwargs are also included.

(func)

Source from the content-addressed store, hash-verified

45
46
47def get_func_full_args(func):
48 """
49 Return a list of (argument name, default value) tuples. If the argument
50 does not have a default value, omit it in the tuple. Arguments such as
51 *args and **kwargs are also included.
52 """
53 params = _get_callable_parameters(func)
54 args = []
55 for param in params:
56 name = param.name
57 # Ignore 'self'
58 if name == "self":
59 continue
60 if param.kind == inspect.Parameter.VAR_POSITIONAL:
61 name = "*" + name
62 elif param.kind == inspect.Parameter.VAR_KEYWORD:
63 name = "**" + name
64 if param.default != inspect.Parameter.empty:
65 args.append((name, param.default))
66 else:
67 args.append((name,))
68 return args
69
70
71def func_accepts_kwargs(func):

Callers 1

get_context_dataMethod · 0.90

Calls 2

_get_callable_parametersFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…