my code run wrong,i don't know why
class a:
def __get__(self):
return 'xxx'
def aa(self):
print 'aaaa'
b=a()
print b.get('aa')
Please try to use the code, rather than text, because my English is not very good, thank you
#class HideX(object):
def __init__(self, x):
self.x = x
def get_x(self):
return self.__x
def set_x(self, x):
self.__x = x+10
x = property(get_x, set_x)
inst = HideX(20)
print inst.x
inst.x = 30
print inst.x