Decorator syntax

AdSR artur_spruce at yahoo.com
Thu Aug 5 13:10:08 CEST 2004


"Paul McGuire" <ptmcg at austin.rr._bogus_.com> wrote in message news:<JEiQc.16955$_25.574 at fe2.texas.rr.com>...
> "Peter Hansen" <peter at engcorp.com> wrote in message
> news:38ednYT1NLz1P4zcRVn-uA at powergate.ca...
> <snip>
> > For the record, the @ syntax is despicable and horribly
> > un-Pythonic, IMHO, and I really hope never to read code that
> > uses it. :-(
> >
> > (And my preferred syntax was "def f() [classmethod]:", FWIW)
> >
> 
> Agreed.  And I also like your preferred syntax - clear, readable, no
> eye-jarring symbols.

That's what I think too. If there has to be a decorator syntax (other
than present "f = decor(f)" rebinding, which makes the process of
decorating as explicit as it gets), that's the one to go.

Effbot's expression of horror at the @ syntax was no surprise to me,
although sudden appearance of the latter was. I read somewhere that
the BDFL allowed this patch because he was tired with the long,
never-ending discussion. I have this conspiracy theory that he did so
to stirr the community and finally get some clear response on what's
best. Which might be a risky but good move.

Which made me think: I'd rather know when I'm losing perspective (and
be able to remedy that) than just try not to lose it.

AdSR



More information about the Python-list mailing list