I've got the following code under python command line. I expect that when I visit an attribute, getattribute is automatically called. But I don't see the result
class D:
def __getattribute__(s,*a,**ka):
print "__getattribute__"
return object.__getattribute__(s,*a,**ka)
def __getattr__(s,name):
print "__getattr__"
return name
def __get__(s,instance,owner):
print "__get__"
return s
a='abc'
class C2(object):
d=D()
>>> d=D()
>>> c2=C2()
>>> print d.a
abc
>>> print d.zzz
__getattr__
No "getattribute" printed. Why?