Possible Duplicate:
How to find out the arity of a method in Python
For example I have declared a function:
def sum(a,b,c):
return a + b + c
I want to get length of arguments of "sum" function.
somethig like this: some_function(sum) to returned 3
How can it be done in Python?
Update:
I asked this question because I want to write a function that accepts another function as a parameter and arguments to pass it.
def funct(anotherFunct, **args):
and I need to validate:
if(len(args) != anotherFuct.func_code.co_argcount):
return "error"