def change_type(self, func):
        """A function that changes types of cells."""
        model = self.model()
        index_list = self.selectedIndexes()
        [model.setData(i, '', change_type=func) for i in index_list]
def change_type ( self , func ) : model = self . model ( ) index_list = self . selectedIndexes ( ) [ model . setData ( i , '' , change_type = func ) for i in index_list ]
A function that changes types of cells.