Given the Python function:
def a_method(arg1, arg2): pass
How can I extract the number and names of the arguments. I.e., given that I h
The Python 3 version is:
def _get_args_dict(fn, args, kwargs): args_names = fn.__code__.co_varnames[:fn.__code__.co_argcount] return {**dict(zip(args_names, args)), **kwargs}
The method returns a dictionary containing both args and kwargs.