[Python-Dev] Proposed tweaks to functools.wraps

Éric Araujo merwok at netwok.org
Wed Aug 11 04:48:03 CEST 2010


> The second (#9396) came up in the context of the new cache decorators
> added to functools, and allowing applications to choose their own
> caching strategies. I suggested exposing the original (uncached)
> function, and Raymond suggested that the easiest way to enable that
> would be for functools.update_wrapper to add a new attribute that
> provides a reference to the original function.

I moved this feature request to its own bug after brief IRC discussion
with RDM: http://bugs.python.org/issue9567

The idea was to separate concerns and eventually get feedback from
people reading new-bugs-announce, but your email actually does that :)

I say “add attribute to partial objects” in the bug title since I don’t
know if it’s feasible in wraps only; while update_wrapper is simple
Python code, wraps merely delegates to _functools.partial, so please
change the title (and maybe add easy keyword) if appropriate.

Regards



More information about the Python-Dev mailing list