[Python-Dev] Proposed tweaks to functools.wraps

Ray Allen ysj.ray at gmail.com
Wed Aug 11 16:38:30 CEST 2010


I think this is a good idea, because sometimes getting the innermost wrapped
function from a wrapper function is very useful. For example, when I use
inspect.getsource(), in most case, I want to get the source code of the
wrapped function, not the wrapper, because the wrapped function usually
contains the most important code. Even further, we can add optional keyword
argument to let the functions in inspect module to get the wrapped function
instead of the wrapper function by following the __wrapped__ chain
automatically.


-- 
Ray Allen
Best wishes!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100811/077314aa/attachment.html>


More information about the Python-Dev mailing list