I want to get the signature of Exception.__init__
using inspect
module but using inspect
module on Python types like Exception
and None
fails with the below error.
/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
I would like to know how signatures of in-built functions of types defined in Python can be obtained.