def extend ( self, undo_item ):
        """ Extends the undo history.

        If possible the method merges the new UndoItem with the last item in
        the history; otherwise, it appends the new item.
        """
        if 0 > self.now:
            undo_list =  self.history[ self.now - 1 ]
            if not undo_list[-1].merge_undo( undo_item ):
                undo_list.append( undo_item )

    #---------------------------------------------------------------------------
    #  Undo an operation:
    #---------------------------------------------------------------------------
dataset/ETHPy150Open enthought/traitsui/traitsui/undo.py/UndoHistory.extend/swapped operands of `>`