what magic methods does @property touch
I've been trying to wrap my head around the @property decorator, and I
think I get it, but I am very curious to know which magic methods
@property (and the builtin property) call. Is it just __get__ and __set__,
or could __getattr__ and __setattr__ be invoked as well? __getattribute__?
__setattribute__?
As I understand it, @someproperty will use __get__, @someproperty.setter
will use __set__, and @someproperty.deleter will call __del__ but I'm
suspicious that I have an over simplified view on this.
I haven't been able to find this information, and I've been searching all
day about properties, so hopefully someone can shed some light on this for
me. Links and examples greatly appreciated.
No comments:
Post a Comment