Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

CPython's float Implementation in C: A double and a Freelist

Oct 20, 2026 7 min read Jay Hubbert

A float is 24 bytes holding one IEEE-754 double. Arithmetic converts both sides to double and boxes the result, and repr always uses 17 significant digits with a trailing .0.

PythonCpythonInternalsFloat

Read more →

CPython's Frame Implementation in C: Two Structs, One Activation Record

Oct 20, 2026 7 min read Jay Hubbert

A CPython frame is really two structs: the compact _PyInterpreterFrame the VM runs on, and the heap PyFrameObject Python code only ever sees — created lazily, and copied if it …

PythonCpythonInternalsFrameFrames

Read more →

CPython's function Implementation in C

Oct 20, 2026 8 min read Jay Hubbert

A Python function is a PyFunctionObject — a shared code object bolted to a globals dict, a tuple of defaults, and a tuple of closure cells — and every call goes through vectorcall.

PythonCpythonInternalsFunction

Read more →

CPython's Generator Implementation in C (types.GeneratorType)

Oct 20, 2026 8 min read Jay Hubbert

Generators, coroutines, and async generators share one struct: an _PyInterpreterFrame embedded directly in the object, so a paused function is a single heap allocation.

PythonCpythonInternalsGeneratorGenerators

Read more →

CPython's int Implementation in C

Oct 20, 2026 8 min read Jay Hubbert

int is a PyObject with a tag word packing sign and digit count plus a little-endian array of 30-bit digits — and every value in -5..1024 is an immortal singleton.

PythonCpythonInternalsInt

Read more →

← Newer Page 18 of 53 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·