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

Tor Iver Wilhelmsen tor.iver.wilhelmsen at broadpark.no
Thu Aug 5 16:33:07 EDT 2004


steven.bethard at gmail.com (Steven Bethard) writes:

> These are, of course, the standard reasons against introducing new
> keywords, and the same reasons that Python tries not to introduce them
> unnecessarily. Still, I think, for example, the 'yield' generator
> syntax (which was introduced relatively recently) is much clearer than
> doing something strange with punctuation would have been.  I guess I
> just don't see why decorators merit strange punctuation when
> generators didn't...

Also, in the case of Java, keywords actually have been introduced
(strictfp, assert), in the latter case leading to a rewrite of the
"standard" unit test library JUnit which changed a framework method
name (assert() -> assertTrue()).

However, a "foreach" would just pollute (in a sense) as long as it's
very close to for, and it demantically makes sense to "reuse" it
instead (like they do for "class", which both is used in a class
declaration and to access a class object statically). Both strictfp
and assert did new things that didn't match what any other language
feature did.



More information about the Python-list mailing list