> i find it difficult to understand the difference between the magic methods
> __getattr__ and __getattribute__
> and so donot know when to use former or later.

>From the docs:

__getattr__(self, name)  Called when an attribute lookup has not found
the attribute in the usual places (i.e. it is not an instance
attribute nor is it found in the class tree for self).

__getattribute__(self, name) Called unconditionally to implement
attribute accesses for instances of the class.

Please see http://docs.python.org/ref/new-style-attribute-access.html
and http://docs.python.org/ref/attribute-access.html

HTH,
Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to