
5 Nov
2009
5 Nov
'09
3:11 p.m.
On Thu, Nov 5, 2009 at 2:55 PM, Mathijs den Burger <mathijs@cs.vu.nl> wrote:
On Thu, 2009-11-05 at 07:27 -0600, Hartmut Kaiser wrote:
So here it goes again:
Well, I stand corrected, it _is_ possible by overloading __getattr__/__setattr__.
Interesting! But wouldn't that become a bit hackish, with many possible side-effects?
__getattr__() is only called if an (Python) instance attribute is not found via the standard lookup mechanism. __setattr__(), however, is called for every (Python) instance attribute assignment. To overload these methods has the potential of causing some trouble and overhead. In __setattr__() every attribute assignment would need to be checked against the list of valid SAGA attributes. Cheers, -- /Manuel