[Python-Dev] Decorators: vertical bar syntax

Neil Hodgson nhodgson at bigpond.net.au
Mon Aug 9 04:37:05 CEST 2004


Greg Ewing:
> > @RemoteCall
> > def Ignite(engine @Remote, environment @Copy, thrust @Float):
>
> Nooooo.....
>
> If @decorator stays in, I fervently hope it won't be taken as a
> precedent for using @ for other things all over the place.  Otherwise
> we really *will* end up with a language that resembles Perl.

   A motivation for this was that one of the examples

@accepts(int,int)
@returns(float)
def bar(low,high):

   which separates related information too much for me. If decorators need
to decorate parameters, they are more likely to be understood correctly by a
reader if the decorations are next to the parameters.

   Neil



More information about the Python-Dev mailing list