slice_index¶
- zixy.utils.slice_index(s: slice, i: int, length: int) int[source]¶
Find an index in the original sequence corresponding to index
iof slices.- Parameters:
s – The slice object.
i – Zero-based index relative to the slice.
length – Length of the sequence being sliced.
- Returns:
The index in the original sequence corresponding to index
iof slices.- Raises:
IndexError – If i is out of the slice bounds.