I believed I was familiar with the fundamentals of list slicing in Python, but I've been getting the following unexpected error while using a negative step on a slice:
>>> a = list(range(10))
>>> a
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> a[:-1]
[0, 1, 2, 3, 4, 5, 6, 7, 8]
>>> a[::-1]
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
>>> a[:-1:-1]
[]
Why does a[:-1:-1] not reverse step through the a[:-1] slice in the same way as it does with a[::-1] over the whole list?
I am aware that list.reverse() may also be used, but I'm attempting to better grasp how Python slices work.