[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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant