Negative indices aren't magic. They follow the obvious wraparound (modular) pattern: Negative `i` indexes the element in array `a` located at `i % len(a)`. If they worked any other way it'd be madness.
[0]: https://en.wikipedia.org/wiki/Modulo_operation#Remainder_cal...