37,744
社区成员




class B(object):
version = 2.0
def __init__(self,x):
self.x = x
self.y = 200
def __getattribute__(self,obj):
if obj == 'x':
return 'xxx'
else:
raise AttributeError
def __getattr__(self,obj):
return 'defaultValue'
def say(self):
print 'this is B'
b = B(100)
print b.x
print b.y