为什么添加了装饰后就不能正常调用了,明明不是已经把方法变成属性了吗
class Person(object):
__slots__ = ('name', 'gender')
def __init__(self, name, gender):
self.name = name
self.gender = gender
class Student(Person):
__slots__ = ('score',)
def __init__(self,name, gender,score):
super(Student,self).__init__(name, gender)
self.__score=score
@property
def score(self):
return self.__score
s = Student('Bob', 'male', 59)
s.name = 'Tim'
s.score = 99
print s.score