For options that you want to omit, replace it with None
. Generally, if any option is omitted, it default to None
.
So option like slice(None, None, None)
is equivalent to a[::]
. Also remember the start
and step
arguments default to None
.
For. ex.
a[5:] -> b=(5,None,None)
a[:12] -> b=(None,12)
a[:] -> b=(None,None)
One thing to note here is, slicing is different from indexing. So you cannot use the slice
built-in if you intend to index.