[Python-Dev] Re: def fn (args) [dec,dec]:

Nicolas Fleury nidoizo at yahoo.com
Fri Aug 6 18:50:27 CEST 2004


Guido van Rossum wrote:
> Yes, this whole thing is deeply about readability.  It *started* with
> the observation that the post-function-body decorator "syntax" had
> usability / readability issues.  A lot of Python is about that.

I agree.  In fact, I've been convinced by both sides that both 
@decorators and list-after-def solutions have major readability 
drawbacks.  For example, this is more readable than both:

decorate classmethod:
     def foo(arg1,arg2):
         ...

But it is less usable when the decorator applies to a single function, 
unless a syntax is allowed to do it without indentation.  And there's a 
new keyword.  But adding a special character to avoid adding a new 
keyword?  Wouldn't a "from __future__ import decorate" until Python 2.X 
or 3 be better?  It seems like a good compromise to me...

Regards,
Nicolas



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