def check_selection_length(selection, shape): if len(selection) > len(shape): err_too_many_indices(selection, shape)