slice_to_tuple

zixy.utils.slice_to_tuple(s: slice, length: int) tuple[int, ...][source]

Get all indices in the original sequence corresponding to indices of slice s.

Parameters:
  • s – the slice to get as a tuple.

  • length – the number of elements in the underlying array.

Returns:

A tuple of indices in the original sequence corresponding to indices of slice s.