- Is there any difference between
mylist[:]andmylist[::]? - What’s the rationale for
mylist[::0]to raise an error since negative steps are allowed?
Is there any difference between mylist[:] and mylist[::] ? What’s the rationale for mylist[::0]
Share
No. Both result in
slice(None, None, None).Positive strides go forwards. Negative strides go backwards. Zero strides go… nowhere? How exactly would that work? An infinite sequence of a single value?