我想要得到的签名Exception.__init__使用inspect模块,但使用inspect模块上的Python类型,如Exception 与None失败,下面的错误。
/usr/lib/python2.7/inspect.pyc in getargspec(func)
814 func = func.im_func
815 if not isfunction(func):
--> 816 raise TypeError('{!r} is not a Python function'.format(func))
817 args, varargs, varkw = getargs(func.func_code)
818 return ArgSpec(args, varargs, varkw, func.func_defaults)
TypeError: <method-wrapper '__init__' of NoneType object at 0x8ff8d0>
is not a Python function
我想知道如何获取在Python中定义的类型的内置函数的签名。
相关分类