slice_index_gen

zixy.utils.slice_index_gen(s: slice, length: int) Iterator[int][source]

Generate indices in the original sequence corresponding to indices of slice s.

Parameters:
  • s – The slice object.

  • length – The length of the underlying sequence.

Returns:

An iterator over the indices in the original sequence corresponding to indices of slice s.