A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/047808.html below:

[Python-Dev] Decorator syntax J2 (decorate..def), with implementation

[Python-Dev] Decorator syntax J2 (decorate..def), with implementationBob Ippolito bob at redivi.com
Sat Aug 14 01:24:24 CEST 2004
On Aug 13, 2004, at 7:31 PM, Michael Sparks wrote:

> Syntax option J2 from the wiki seems to have provoked an interesting
> discussion[1] at least by a small subset of c.l.p, so I wondered how
> difficult it would be to implement - this turned out to be relatively
> simple [2].
>    [1] 
> http://mail.python.org/pipermail/python-list/2004-August/233413.html
>    [2] 
> http://mail.python.org/pipermail/python-list/2004-August/233591.html
>        (implementation)
>
> #Syntax J2 from http://www.python.org/moin/PythonDecorators
> decorate:
>      staticmethod
>      grammarrule('statement : expression')
>      versioninfo("Added in 2.4")
>      deprecated
>      typeinfo(None)
> def p_statement_expr(self, p):
>      print p[1]

My only problem with this syntax is that I expect the common cases 
(mine, anyway) to be zero or one decorators per function, so the extra 
block and indent seems a bit excessive compared to the current 
@prefix-symbol-decorator proposal(s).  It is, of course, far better 
than typing the function name three times though! :)

-0

-bob
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4