[Baypiggies] A few decorator questions...

Shannon -jj Behrens jjinux at gmail.com
Thu Feb 26 09:56:15 CET 2009


On Wed, Feb 25, 2009 at 11:36 PM, Charles Merriam
<charles.merriam at gmail.com> wrote:
> In the spirit of just in time research for the newbie nugget tomorrow:
>
> What decorators do most people actually use?  I expect everyone to use
> the built-in @classmethod, @staticmethod, and @property.   Also, I
> expect usage of many of the recipes from
> http://wiki.python.org/moin/PythonDecoratorLibrary, like @memoize or
> @trace.   Also, many different frameworks provide decorators for use
> with that framework.  Am I missing something obvious?
>
> Also, there had been some chatter about making a standardized
> variable, like __decorators__[] which would hash the doc strings of
> each decorator used into a well behaved array of hashes.  The
> arguments weren't the strongest, and from the lack of support in
> @functools.wrap, I assume it never occurred.
>
> Finally, several people from a well known search company had said the
> company banned use of decorators internally.   If you are with that
> search company and can let me know the rational, I'd be curious.  You
> can email me off list if you prefer.
>
> I'm trying to finish a couple interesting class decorators for examples.
>
> Have a great day,

One of my favorite decorators is the decorator decorator:
http://pypi.python.org/pypi/decorator

It makes decorating other functions with decorators quite pleasant.
Pylons uses it too.

-jj

--
In this life we cannot do great things. We can only do small things
with great love. -- Mother Teresa
http://jjinux.blogspot.com/


More information about the Baypiggies mailing list