python property
@property
@num.setter
class Test(object): def __init__(self): self.__num = 100 @property def num(self): print("----getter----") return self.__num @num.setter def num(self, newNum): print("----setter----") self.__num = newNum
@property
@num.setter
class Test(object): def __init__(self): self.__num = 100 @property def num(self): print("----getter----") return self.__num @num.setter def num(self, newNum): print("----setter----") self.__num = newNum