(self, name, value)
Limit setting attributes
Limit setting attributes
Limit setting attributes
def __setattr__(self, name, value):
        """Limit setting attributes"""
        if hasattr(self, name):
            object.__setattr__(self, name, value)
        else:
            raise AttributeError('%r object has no attribute %r' %
                                 (self.__class__.__name__, name))
def __setattr__ ( self , name , value ) : if hasattr ( self , name ) : object . __setattr__ ( self , name , value ) else : raise AttributeError ( '%r object has no attribute %r' % ( self . __class__ . __name__ , name ) )