I am looking to do something similar to what was asked here Getting list of parameter names inside python function, but using partial functions. ie. I need to get the possible arguments for a partial function. I can get the keyword arguments using:
my_partial_func.keywords
but I am currently struggling to get the non-keyword arguments. The inspect module also yields nothing for this particular case. Any suggestions would be great.
.argscontains the arguments passed to the partial function. If you want to get the arguments that the original function expects, use theinspectsolution you linked on the.funcattribute.You can find this out by calling
diron a functools.partial object: