[Python-ideas] @setattr(obj, [name])

Andrey Fedorov anfedorov at gmail.com
Sun Jun 6 18:05:03 CEST 2010


George Sakkis wrote:

> Thoughts ?
>

I liked the idea, then realized that I was misunderstanding it deeply. I
would have expected

@setattr('key', "value")
def bar(): pass


make

bar.key == "value"


This was just my intuition from hearing "setattr decorator" and glancing
over your email. But deceiving name aside, I think this is a useful
decorator. I would just call it @method_of.

- Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100606/e1b04c0f/attachment.html>


More information about the Python-ideas mailing list