5eb110b
1
2
3
4
idxs = (1, 2) array_slice = array[0, *idxs, -1] # Equivalent to [0, 1, 2, -1] array[0, *idxs, -1] = array_slice # Also allowed