Skip to content
Opensource internals
  • Posts

Cell

How CPython Implements Cell (types.CellType) in C

Oct 20, 2026 9 min read Jay Hubbert

Python’s cell – the object exposed as types.CellType and the thing that makes nonlocal (and closures) work – is implemented in CPython in Objects/cellobject.c as a tiny GC-tracked …

PythonCpythonInternalsCell

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·