How Python Creates and Destroys Lists—and What the Free List Looks Like
This article explains CPython’s list creation via PyList_New, details memory allocation, the role of the free‑list cache, the deallocation process in list_dealloc, and the trashcan mechanism that prevents recursion overflow, illustrating each step with code snippets and concrete examples.
