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
Returns a list of argument names, takes care of partials and regular functions:
def get_func_args(f): if hasattr(f, 'args'): return f.args else: return list(inspect.signature(f).parameters)