[Python-Dev] Decorator syntax (original) (raw)

James Y Knight foom at fuhm.net
Wed Sep 2 16:35:29 CEST 2009


On Sep 2, 2009, at 6:15 AM, Rob Cliffe wrote:

So - the syntax restriction seems not only inconsistent, but pointless; it doesn't forbid anything, but merely means we have to do it in a slightly convoluted (unPythonesque) way. So please, Guido, will you reconsider?

Indeed, it's a silly inconsistent restriction. When it was first added
I too suggested that any expression be allowed after the @, rather
than having a uniquely special restricted syntax. I argued from
consistency of grammar standpoint. But Guido was not persuaded. Good
luck to you. :)

Here's some of the more relevant messages from the thread back when
the @decorator feature was first introduced: http://mail.python.org/pipermail/python-dev/2004-August/046654.html http://mail.python.org/pipermail/python-dev/2004-August/046659.html http://mail.python.org/pipermail/python-dev/2004-August/046675.html http://mail.python.org/pipermail/python-dev/2004-August/046711.html http://mail.python.org/pipermail/python-dev/2004-August/046741.html http://mail.python.org/pipermail/python-dev/2004-August/046753.html http://mail.python.org/pipermail/python-dev/2004-August/046818.html

James



More information about the Python-Dev mailing list