I need to determine the argspec (inspect.getargspec) of a function within a decorator:
def decor(func):
@wraps(func)
def _decor(*args, **kwargs):
return func(*args, **kwargs)
return _decor
@decor
def my_func(key=1, value=False):
pass
I need to be able to inspect the wrapped "my_func" and return the key/value arguments and their defaults. It seems that inspect.getargspec doesn't get the proper function.
(FWIW I need this for some runtime inspection/validation and later documentation generation)