[Python-Dev] Re: PEP 318: Decorators last before colon (original) (raw)

David Abrahams dave at boost-consulting.com
Thu Apr 1 17:25:20 EST 2004


Jeremy Hylton <jeremy at alum.mit.edu> writes:

On Thu, 2004-04-01 at 07:13, Michael Hudson wrote:

> I don't think Michel is saying they are worthless. However, the > proposed syntax is highly contentious. It would be good if there > was a short term solution that wouldn't require new syntax. That > would give Guido and the Python community time to figure out the > best syntax.

We've been discussing this off and on for OVER A YEAR! If 'the best syntax' hasn't been figured out yet after N thousand emails on the subject, I see no reason to believe enlightenment is going to arrive soon (or ever). There's no particular reason to believe that effort alone will arrive at an elegant solution. On the other hand, maybe there isn't a good syntax for arbitrary decorators.

Has something along these lines been discussed?

with [staticmethod, classmethod]:

 def foo(x):
     pass

 def bar(x):
     pass

IIUC, the PyObjC application needs whole swathes of functions with the same decoration, but this syntax isn't much worse for one function than for many.

-- Dave Abrahams Boost Consulting www.boost-consulting.com



More information about the Python-Dev mailing list