I am wondering if there is a way to determine (given a variable containing a lambda) the number of parameters the lambda it contains. The reason being, I wish to call a functio
Lambdas are functions like any other. The argument count is stored in func.__code__.co_argcount.
func.__code__.co_argcount
>>> foo = lambda x, y=2: x+y >>> foo.__code__.co_argcount 2 >>> foo = lambda x, y=2, z=3: x+y+z >>> foo.__code__.co_argcount 3