decorators

sjdevnull at yahoo.com sjdevnull at yahoo.com
Thu Nov 9 00:22:42 EST 2006


John Henry wrote:
> I must be very thick.  I keep reading about what decorators are and I
> still don't have a good feel about it.  See, for example:
>
> http://alex.dojotoolkit.org/?p=564
>
> What exactly do I use decorators for?

Metafunctions.  Saying

@mydecorator
def foo(...):
  ...

is just an alternative way of writing:
def foo(...):
  ...
foo = mydecorator(foo)




More information about the Python-list mailing list