[Python-Dev] Call for defense of @decorators

Anthony Baxter anthony at interlink.com.au
Fri Aug 6 03:21:54 CEST 2004


My take on the @decorator syntax is that after initially
hating it, I've found it growing on me more and more.
It's extremely clear and very readable. Most importantly,
in my eyes, it's obviously grouped with the def that
follows it. From being a -0 (when Guido first mentioned
it) to a +0 (at the time of checkin) I'm now +1 on this
form of decorator.

(It's different in that way to "print >>", which I still
hate <wink>)

A couple of other arguments that I've seen:

"This is a backwards-incompatible change to Python's syntax."
So are generator expressions, and they're way harder to spot
in a piece of code. Python syntax changes over time, that's
always been how it is.

"The @ sign is used in tool X."
This is disappointing, but it can't be the sole reason to
not use @ - Python can't be constrained to not breaking any
other existing third-party tools. Hopefully there's a
solution to the Leo problem - perhaps doubling the @ sign
for Leo?

"The @ sign is used in Perl."
And?


-- 
Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.




More information about the Python-Dev mailing list