Skip to content
Opensource internals
  • Posts

Buffer protocol

CPython's memoryview Implementation in C

Oct 20, 2026 9 min read Jay Hubbert

CPython splits memoryview into a shared managed-buffer snapshot and a per-view copy of shape/strides, so slicing adjusts pointers instead of copying data.

PythonCpythonInternalsMemoryviewBuffer protocol

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 →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·