[Python-Dev] Adding functools.decorator

Guido van Rossum guido at python.org
Mon May 1 16:51:35 CEST 2006


On 4/30/06, Georg Brandl <g.brandl at gmx.net> wrote:
> Guido van Rossum wrote:
> > I expect that at some point people will want to tweak what gets copied
> > by _update_wrapper() -- e.g. some attributes may need to be
> > deep-copied, or personalized, or skipped, etc.
>
> What exactly do you have in mind there? If someone wants to achieve this,
> she can write his own version of @decorator.

I meant that the provided version should make writing your own easier
than copying the source and editing it. Some form of subclassing might
make sense, or a bunch of smaller functions that can be called for
various actions. You'll probably have to discover some real use cases
before you'll be able to design the right API for this.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list