CPython's NoneType Implementation in C (None)
None is a single static immortal PyObject: no allocation, no refcounting, and identity comparison — plus a dedicated stack-ref encoding for the eval loop.
All posts published on this site.
Everything published here, newest first.
None is a single static immortal PyObject: no allocation, no refcounting, and identity comparison — plus a dedicated stack-ref encoding for the eval loop.
NotImplemented is an immortal static singleton that binary operators return to say ’not my job’ — the interpreter then tries the reflected operand before raising TypeError.
object is a 16-byte struct holding just ob_refcnt and ob_type — and PyBaseObject_Type fills in the defaults every other type inherits or overrides.
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.
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.