from __future__ import decorators

Jacek Generowicz jacek.generowicz at cern.ch
Mon Jan 17 03:26:53 EST 2005


Tim Roberts <timr at probo.com> writes:

> Jacek Generowicz <jacek.generowicz at cern.ch> wrote:
> >
> >I have some code, which makes copious use of the @decorator syntax
> 
> I'm very curious to know what kind of application you are writing in which
> "copious use of the @decorator syntax" actually solved a problem
> productively.

An application in which, before python2.4, I used to have lots of code
that looked like

def somefun(...):
    ...
somefun = somedecorator(somefun)

:-)


It's not interesting to discuss what "somedecorator" actually
represents. But being able to see that the function is decorated right
next to the "def", as opposed to having to look beyond the end of the
definition certianly makes a significant difference to me.



More information about the Python-list mailing list