[Python-ideas] Multiple arguments for decorators

Michael Selik mike at selik.org
Tue Dec 1 00:18:49 EST 2015


On Mon, Nov 30, 2015 at 11:38 PM Chris Angelico <rosuav at gmail.com> wrote:

> And while I called the class-based system "ugly" to start
> with, I'm coming around to it more and more - especially since it
> works in current versions of Python, rather than demanding core
> interpreter changes. It's not the most intuitive use of syntax either
> (the 'class' block isn't really creating a class at all - it creates a
> function parameter list), but it isn't as bad as I thought it was.
>

One advantage of the ``@property`` syntax is that one can show a new
Pythonista how to create read-only properties without needing to explain
too many new concepts. Using ``@foo.setter`` sometimes requires a bit more
hand-waving.

Is there a way to use the metaclass and class-in-a-class as Kevin
Modzelewski wrote, but hiding some of the complexity behind a decorator?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151201/1e3ee8b4/attachment.html>


More information about the Python-ideas mailing list