def __setattr__(self, name, value): #Make sure attribute is not read-only if name in self.__class__._readOnlyAttrs: raise NoModificationAllowedErr() #If it's computed execute that function attrFunc = self.__class__._writeComputedAttrs.get(name) if attrFunc: attrFunc(self, value) #Otherwise, just set the attribute else: self.__dict__[name] = value
def __setattr__(self, name, value): if name in ['root', 'filter', 'expandEntityReferences', 'whatToShow']: raise NoModificationAllowedErr() self.__dict__[name] = value
def __setattr__(self, name, value): if name == 'length': raise NoModificationAllowedErr() #Pass-through self.__dict__[name] = value
def _set_length(self, value): raise NoModificationAllowedErr()