[Python-ideas] Multiple arguments for decorators

Guido van Rossum guido at python.org
Tue Dec 1 10:48:44 EST 2015


On Tue, Dec 1, 2015 at 1:01 AM, Andrew Barnert via Python-ideas <
python-ideas at python.org> wrote:
[...]
>
>
> And again, what's the benefit from this extra complexity? Unless you have
> a whole lot of decorators written that all need this exact same
> transformation, you're just abstracting out an arbitrary part of the logic
> that doesn't seem to fit any natural grain.
>

I'm assuming this recurring desire to improve on the property decorator is
because there are several other languages where a compact way to declare
getters and setters is part of the language syntax, and it usually takes
the form of an indented block containing some functions.

But how important is this really? I did a quick count on a fairly big and
complex code base I happened to have sitting around. It has 10x more
classes than properties, and only a tiny fraction of those use the
@x.setter notation. If that's the norm I'm not sure we need more.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151201/c34004a8/attachment.html>


More information about the Python-ideas mailing list