bearophile Wrote: > Another example are range bounds, you can omit them, or exactly the same, > they can be None: > > a = ['a', 'b', 'c', 'd'] > >>> assert a[None : 2] == ['a', 'b'] > >>> assert a[ : 2] == ['a', 'b'] > >>> assert a[0 : 2] == ['a', 'b'] > >>> idx = None > >>> assert a[idx : 2] == ['a', 'b'] > >>> assert a[2 : None] == ['c', 'd'] > >>> assert a[2 : ] == ['c', 'd'] > >>> assert a[2 : len(a)] == ['c', 'd']
half of a slice: a[None+len(a) : None]
