def __setitem__(self, key, value): self.current_dict.__setitem__( key, _convert_to_edit_object(value, self, key)) self.append_edits(nup.Edit('set', [key], value))
def update(self, update_dict): for k, v in update_dict.items(): self.current_dict.__setitem__(k, _convert_to_edit_object(v, self, k)) self.append_edits(nup.Edit('update', [], update_dict))
def __delitem__(self, key): self.current_dict.__delitem__(key) self.append_edits(nup.Edit('del', [], key))
def insert(self, i, v): vc = _convert_to_edit_object(v, self, i) self.current_list.insert(i, vc) self.append_edits(nup.Edit('insert', [i], v))
def extend(self, other_list): for v in other_list: self.current_list.append( _convert_to_edit_object(v, self, len(self.current_list))) self.append_edits(nup.Edit('extend', [], other_list))
def append(self, value): self.current_list.append( _convert_to_edit_object(value, self, len(self.current_list))) self.append_edits(nup.Edit('append', [], value))
def __delitem__(self, o): self.current_list.__delitem__(o) self.append_edits(nup.Edit('del', [], o))