Two fixes to
shift_sliceassumed its argument
slicesto be iterable. Thus, it did not accept single slices as arguments. There are use cases, though, where it is necessary to shift a plain
sliceobject, or even
floatobjects which can also be seen as slices. An additional
isinstancecheck takes care of this.
lists of slices. By default, Python wraps multidimensional slices as
tuples. Code for manipulating multidimensional slices thus expects them to be given as tuples. Also, although it is currently possible to access numpy arrays with lists of slices instead of tuples, this action produces a deprecation warning. Thus,
shift_sliceis changed to return tuples.
An additional test case evaluating array accesses with shifted slices is also added.