I think the problem lie in there :
def wrapper(*args, **kwargs):
print('inside wrapper')
return func(*args, **kwargs)
even if it @wraps(func)
, wrapper
might take more arguments, so the signature you see is the signature of wrapper
. There is no way to magically know what you want to do.
This will not be specific to IPython, and can be found elsewhere on stack overflow like Preserving signature of decorated function. Hope this will solve your issue.