whats the reason to use the variable the self._age? A similar name that doesn’t link to the already used self.age?
class newprops(object):
def getage(self):
return 40
def setage(self, value):
self._age = value
age = property(getage, setage, None, None)
self.ageis already occupied by the property, you need to give another name to the actual variable, which is_agehere.BTW, since Python 2.6, you could write this with decorators: