class accesscontrol: def __setattr__(self, attr, value): if attr == 'age': self.__dict__[attr] = value else: raise AttributeError, attr + ' not allowed'X = accesscontrol()X.age = 40 # calls __setattr__print X.ageX.name = 'mel'print X.name
Name (required)
email (will not be published) (required)
Website