[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