Skip to content
Opensource internals
  • Posts

Python

How CPython Implements dict in C

Oct 20, 2026 9 min read Jay Hubbert

Python’s dict is a hash table with a twist: since 3.6 it is compact and preserves insertion order, and since 3.3 a single keys object can be shared by many instances of the same …

PythonCpythonInternalsDict

Read more →

How CPython Implements Ellipsis in C

Oct 20, 2026 7 min read Jay Hubbert

Python’s Ellipsis is the object spelled .... It is a singleton: there is exactly one instance, and type(Ellipsis) is types.EllipsisType. In CPython it lives in …

PythonCpythonInternalsEllipsis

Read more →

How CPython Implements enumerate (and zip/reversed) in C

Oct 20, 2026 7 min read Jay Hubbert

Python’s enumerate, zip, and reversed are not functions that build lists. They are lazy iterator objects implemented in C. enumerate lives in Objects/enumobject.c alongside …

PythonCpythonInternalsEnumerateZipReversed

Read more →

How CPython Implements Exceptions in C

Oct 20, 2026 7 min read Jay Hubbert

Python exceptions are ordinary objects. In CPython every exception instance is a PyBaseExceptionObject (or a subclass struct that starts with the same PyException_HEAD), allocated …

PythonCpythonInternalsExceptions

Read more →

How CPython Implements float in C

Oct 20, 2026 6 min read Jay Hubbert

Python’s float is a thin wrapper around a C double. In CPython that is implemented by PyFloatObject in Objects/floatobject.c, and almost every operation reduces to doing C double …

PythonCpythonInternalsFloat

Read more →

← Newer Page 3 of 11 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·