Skip to content
Opensource internals
  • Posts

Cpython

CPython's NotImplemented Implementation in C

Oct 20, 2026 7 min read Jay Hubbert

Python’s NotImplemented is not an exception and not a function result that means “I gave up.” It is a real singleton object of type NotImplementedType, returned from operator …

PythonCpythonInternalsNotimplemented

Read more →

CPython's object Implementation in C

Oct 20, 2026 7 min read Jay Hubbert

Every Python value is a PyObject *. The type that defines what that pointer points at is object itself, implemented in CPython as PyBaseObject_Type in Objects/typeobject.c. Its …

PythonCpythonInternalsObject

Read more →

CPython's OrderedDict in C: O(1) Insertion Order That Just Works

Oct 20, 2026 12 min read Jay Hubbert

OrderedDict is a dict subclass with a linked list of keys and a lazily rebuilt mirror array, giving O(1) node lookup without touching every dict resize.

PythonCpythonInternalsOrdereddictCollections

Read more →

CPython's pickle.PickleBuffer Implementation in C: Out-of-Band Data Without Copies

Oct 20, 2026 7 min read Jay Hubbert

PickleBuffer is a tiny C object that holds one Py_buffer view and forwards every buffer request straight to the original exporter — no copies, no managed-buffer layer.

PythonCpythonInternalsPickleBuffer protocol

Read more →

CPython's PyCapsule Implementation in C: A void* Wrapper for Extension Modules

Oct 20, 2026 9 min read Jay Hubbert

A PyCapsule is a typed, name-checked void* wrapper: the name stops you reading the wrong capsule, and the destructor gets one shot to clean up before the memory goes.

PythonCpythonInternalsCapsule

Read more →

← Newer Page 6 of 11 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·