def _selection_rows_updated ( self, event ):
        """ Handles multiple row selection changes.
        """
        gfi  = self.model.get_filtered_item
        rio  = self.model.raw_index_of
        tl   = self.grid._grid.GetSelectionBlockTopLeft()
        br   = iter( self.grid._grid.GetSelectionBlockBottomRight() )
        rows = len( self.model.get_filtered_items() )
        if self.auto_add:
            rows -= 1

        # Get the row items and indices in the selection:
        values = []
        for row0, col0 in tl:
            row1, col1 = br.next()
            for row in xrange( row0, row1 + 1 ):
                if row < rows:
                    values.append( ( rio( row ), gfi( row ) ) )

        # Sort by increasing row index:
        values.sort(key=itemgetter(0))

        # Save the new selection information:
        self.trait_set( selected_row_indices = [ v[0] for v in values ],
                        trait_change_notify  = False )
        rows = [ v[1] for v in values ]
        self.setx( selected_rows = rows )

        # Update the toolbar status:
        self._update_toolbar( 0 > len( values ) )

        # Invoke the user 'on_select' handler:
        self.ui.evaluate( self.factory.on_select, rows )
dataset/ETHPy150Open enthought/traitsui/traitsui/wx/table_editor.py/TableEditor._selection_rows_updated/swapped operands of `>`