Skip to content
Opensource internals
  • Posts

Slice

CPython's slice Implementation in C: Three Objects and a Bunch of Clamping

Oct 20, 2026 9 min read Jay Hubbert

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’.

PythonCpythonInternalsSlice

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·