In my experiments with decorators, it is common to wrap the original function with a new function. After creating the new function, there are efforts to make it look like the old: newf.__doc__ = oldf.__doc__ # copy the docstring newf.__dict__.update(oldf.__dict__) # copy attributes newf.__name__ = oldf.__name__ # keep the name (new in Py2.4) All is well and good except the argspec. Running help() on the new function gives: funcname(*args, **kwds) The original docstring Running help() on the original function gives: funcname(arg1, arg2) The original docstring So, it would be nice if there were some support for carrying forward the argspec to inform help(), calltips(), and inspect(). FWIW, I do know that with sufficient gyrations a decorator could do this on its own, but it is way too difficult for general use. Raymond
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4