code: def addattr(self, attrname, value=None, persistent=True):
          
          setattr(self, attrname, value)
          # add as persistent
          if persistent and attrname not in self.__persistent_attributes__:
              self.__persistent_attributes__.append(attrname)
docs: Adds an attribute to self. If persistent is True, the attribute will
          be made a persistent attribute. Persistent attributes are copied
          whenever a view or copy of this array is created. Otherwise, new views
          or copies of this will not have the attribute.