Instead, you need to look inspect.getargspec().keywords. If Noneno is specified **kwargs.
From the inspect.getargspec()documentation :
varargs and keywords are the names of the arguments *and **or None.
Demo:
>>> import inspect
>>> def foo(): pass
...
>>> def bar(**kwargs): pass
...
>>> inspect.getargspec(foo).keywords is None
True
>>> inspect.getargspec(bar).keywords is None
False
>>> inspect.getargspec(bar).keywords
'kwargs'
source
share