On Wed, Sep 2, 2009 at 10:35 AM, James Y Knight<f...@fuhm.net> wrote: > 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
I think Guido may have a point about not allowing any arbitrary expression. But I do think that if it allows calls, it should also at least support the itemgetter syntax, for which there seems to be a demonstrable use case. But that's just adding on another special case, so it might be simpler to allow arbitrary expressions. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com