Duncan Booth <duncan.booth at invalid.invalid> wrote: > the invariant that you are looking for is that for all non-negative a, b: > x[a:b:1] reversed is x[-len(x)+b-1:-len(x)+a-1:-1] > I should of course have said "all a, b in the range 0 <= a <= len(x) and 0 <= b <= len(x)".