Decorator Base Class: Needs improvement.
Kay Schluehr
kay.schluehr at gmx.net
Tue Apr 5 13:47:10 EDT 2005
Bengt Richter wrote:
> From the 2.4 Grammar, the key part seems to be
>
> decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
> decorators: decorator+
> funcdef: [decorators] 'def' NAME parameters ':' suite
>
> and further on
>
> dotted_name: NAME ('.' NAME)*
>
> So the Python Grammar's name for the @-expression is just plain
"decorator"
> which conflicts with my English-based reading of the word ;-/
What about playing with the words decorator/decoration? The allegoric
meaning of the decorator
def deco(f):
pass
would be: f is "vanishing under decoration" - all is vanity.
In the example deco would be both a decorator and a decoration. In
other examples deco were a decorator and deco(x,y) the decoration.
Regards,
Kay
More information about the Python-list
mailing list