37,722
社区成员
发帖
与我相关
我的任务
分享
class test:
def __init__(self):
self.__dict__['Name']='test'
def __getattribute__(self,PropName):
print 'Get property %s'%PropName
return object.__getattribute__(self,PropName)
#然后测试
m=test()
print m.name#实际上,这个时候按照书上讲的,这时候就会调用__getattribute__这个函数的,应该打印出
'Get property name'然后在打印'test',但是,却只打印了test,说明根本就没调用__getattribute__这个函数,
请问是取消了这个函数的调用么?