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/047846.html below:

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

[Python-Dev] Decorator syntax J2 (decorate..def), with implementationNick Coghlan ncoghlan at iinet.net.au
Mon Aug 16 01:58:55 CEST 2004
Barry Warsaw wrote:

> On Fri, 2004-08-13 at 19:24, Bob Ippolito wrote:
> 
> 
>>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! :)
> 
> 
> Same here.  It trades one line at the end of the function for two (or
> more) before the beginning of the function.
> 
> -0

What about the variant which makes the block optional when there is only 
one decorator?

i.e.
   decorate: staticmethod
   def foobar():
     pass

The other thing I like about this version is that a folding editor like 
PythonWin can easily compress a decorated definition down to two lines, 
while leaving it clear that the function *is* decorated. That's not a 
huge point, though.

Cheers,
Nick.

-- 
Nick Coghlan               |  Eugene, Oregon
Email: ncoghlan at email.com  |             USA
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