|
|
|
|
|
by childintime
545 days ago
|
|
Python might have used array[~0] instead, where ~ is required, to indicate end-of-list 0-based indexing. But I guess they wanted to iterate from the end back [-1] to the start [0], making it easy to implement a rotating buffer. |
|
This is what was once added to C#: arr[^idx], when this ^idx is mapped to a special object, typically optimized then out. arr[^0] means the last element.