[Python-Dev] Re: Decorators: vertical bar syntax

Raymond Hettinger python at rcn.com
Sun Aug 8 21:57:17 CEST 2004


> > > I agree with Paul here.  The only reason I suggested | was to make
> life
> > > easier for 3rd party tools.
> >
> > But does it?
> >
> > With @, a third party tool has an unambiguous indication of whether
a
> > line is a decorator.  With |, it is not possible to recognize
decorators
> > with a regular expression, instead you have to do some context-free
> > parsing to determine whether some previous line has an unclosed
paren
> > (in which case the | is a binop rather than a decorator).
> 
> Oh ick.  I hadn't thought of that, but if that's going to cause a
> problem given the current grammar (and I can't test that atm), then
I'm
> going to have to retract my support for |.

An exclamation point would be better in this regard.


Raymond



More information about the Python-Dev mailing list