[Python-ideas] Multiple arguments for decorators

Sven R. Kunze srkunze at mail.de
Tue Dec 1 11:34:50 EST 2015


I think I can also confirm that setters **usually** not needed in Python.


On 01.12.2015 16:48, Guido van Rossum wrote:
> On Tue, Dec 1, 2015 at 1:01 AM, Andrew Barnert via Python-ideas 
> <python-ideas at python.org <mailto: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 <http://python.org/%7Eguido>)
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151201/1f0fe83f/attachment-0001.html>


More information about the Python-ideas mailing list