CPython's slice Implementation in C: Three Objects and a Bunch of Clamping
A slice is just three PyObject pointers — but turning them into real indices takes two clamping passes, and None becomes a sentinel meaning ‘use the extreme bound’.
A slice is just three PyObject pointers — but turning them into real indices takes two clamping passes, and None becomes a sentinel meaning ‘use the extreme bound’.