I was surprised to read here that
The
start
andstep
arguments default toNone
since it also says:
slice(start, stop, step=1)
Return a slice object representing the set of indices specified by range(start, stop, step).
So I expected the default argument value for the step
parameter to be 1
.
I know that slice(a, b, None) == slice(a, b, 1)
returns False
, but I am curious if slice(a, b, None)
always returns the same slice as slice(a, b, 1)
, or if there is some example that I haven't been able to think of for which they will return different slices.
I couldn't find anything about this in the extensive post on slicing here