[Python-Dev] Decorator syntax

2009-09-02 Thread Rob Cliffe
Hi All, This is my first post to python-dev so I will briefly introduce myself: My name is Rob Cliffe and I am a commercial programmer living in London, UK. I have some 30 years of programming experience but have only been using Python for a couple of years. First I want to say what a

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Carl Johnson
Crossposting to Python-ideas, I asked for the same change to the grammar a couple months back on python-ideas. See http://mail.python.org/pipermail/python-ideas/2009-February/thread.html#2787 I'm all for it, but you'll have to convince Guido that this won't result in confusing to read code. My

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Xavier Morel
On 2 Sep 2009, at 12:15 , Rob Cliffe wrote: @Identity(DecoList[0])# THIS WORKS def foo(): pass For what it's worth, you don't need an id function, you can simply write @itemgetter(0)(decorators) def foo(): 'whatever' or @decorators.__getitem__(0) def foo():

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread James Y Knight
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

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Erik Bray
On Wed, Sep 2, 2009 at 10:35 AM, James Y Knightf...@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.

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Eric Smith
Erik Bray wrote: 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

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread MRAB
James Y Knight 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?