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
inspect.signature is very slow. Fastest way is
inspect.signature
def f(a, b=1, *args, c, d=1, **kwargs): pass f_code = f.__code__ f_code.co_varnames[:f_code.co_argcount + f_code.co_kwonlyargcount] # ('a', 'b', 'c', 'd')