Decorator syntax (was Re: PEP 318 - PyFIT comments)

Istvan Albert ialbert at mailblocks.com
Wed Aug 4 22:27:18 EDT 2004


Bruce Eckel wrote:

> This is very similar to attributes/metadata in Java J2SE 5 and in C#.
> The thing is, metadata is a little bit weird; it's intentionally
> outside of the domain of the 'normal' programming language, because it
> expresses things that you can't or shouldn't within the normal
> programming language. So you _do_ need an escape mechanism. 

But the escape mechanism does not have to take the shape of
funny, loaded symbols.

Are these really necessary? Aren't they a just premature
solution (shortcuts) to a problem that may not even exist?
I am most irritated by the requirement of spreading out a function
definition over two lines.

> also takes a little bit of getting used to; it's orthogonal to what
> you normally think of as a language feature. But the potential for
> metadata features, at least in Java, is very powerful.

I always felt that Java was too rigid and that any kind
of loosening feels like a breath of fresh air. That is much less the
case in Python. If anything people sometimes want a little
more "discipline". This is what this PEP was initially about.
Too bad that instead of quickly settling at something really
simple like:

def static foo():
    ...

the urge to solve all future problems in the most generic manner
possible lead to increasingly hairy syntaxes and made
the decision process so prolonged, fruitless and boring
that GvR just got fed up with everybody.

Istvan.




More information about the Python-list mailing list