📜  python 获取函数的参数个数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:40.833000             🧑  作者: Mango

代码示例1
from inspect import signature

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

sig = signature(someMethod)
print(len(params))  # 3