Answers for "python get number of arguments of a function"

0

python get number of arguments of a function

from inspect import signature

def someMethod(self, arg1, kwarg1=None):
    pass

sig = signature(someMethod)
print(len(params))  # 3
Posted by: Guest on July-04-2021

Code answers related to "python get number of arguments of a function"

Python Answers by Framework

Browse Popular Code Answers by Language