Using metaclasses to play with decorators.
dmq at gain.com
Sat Jun 26 02:58:42 CEST 2004
On Thu, 24 Jun 2004 08:57:49 -0400, "Colin J. Williams"
<cjw at sympatico.ca> wrote:
>David MacQuigg wrote:
>> The example above was to explain decorators, not justify them. If
>> they were to be used *only* to clean up the current syntax for
>> staticmethod, then I would say a better alternative would be to get
>> rid of the need for a separate staticmethod form entirely. ( See the
>> thread "Unification of Methods and Functions" for a thorough
>> discussion of this topic.)
>> Are decorators on functions necessary? I can't think of a simpler or
>> more consistent way to handle all the variations proposed in PEP 318.
>> Assuming that we *will* have a decorator syntax with many options, I
>> think that making [staticmethod] one of those options is appropriate.
>> I would still prefer a word more meaningful to new users, however. The
>> rational I have heard for "staticmethod" is so contorted, it is not
>> worth repeating.
>> -- Dave
>PEP 318 seems to focus on the "how" to implement decorators, rather than
>the "why". Is there some accessible explanation of the purpose of them?
The first few sections of the PEP are your best summary ( Abstract,
Motivation, Background, Design Goals ). Other than that, I would
search the discussion of this PEP in the python-dev mailing list.
There are some specific links in the Background section of the PEP.
More information about the Python-list