[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 6 05:10:11 CET 2011

MRAB wrote:
> On 05/03/2011 22:53, Greg Ewing wrote:
>> Another approach might be to make it a standard part of the
>> class creation process to go through the attribute dict
>> looking for objects with __setname__ methods and calling
>> them. That would mean the feature would only be available
> With classes, couldn't that be done just as easily now with a decorator?

I suppose it could, but then the burden is on the user to
apply the decorator to each class in which he wants to use
things that rely on it. That doesn't seem very satisfactory.


More information about the Python-ideas mailing list