Skip to main content

7 docs tagged with "internals"

View all tags

Bytecode and the Compiler

How Python source becomes bytecode, the dis module, .pyc files, peephole optimisation, and writing a bytecode-level function.

CPython Architecture

The CPython source tree, the main evaluation loop, and how Python executes a .py file from disk to output.

CPython in Python 3.13

Free-threaded Python, the specialising adaptive interpreter, immortal objects, sub-interpreters, and what changed in the 3.10–3.13 internals.

Memory Management Internals

CPython's memory allocator layers, the pymalloc arena system, reference counting, cyclic GC generations, and how memory is actually freed.

Python Objects Under the Hood

PyObject layout, type objects, reference counting, small integer cache, string interning, and the cost of Python's dynamic type system.

The GIL Explained

What the GIL is, why it exists, how it works in CPython 3.12+, its performance impact, and the Python 3.13 free-threaded mode.

Writing Python C Extensions

The Python C API, writing and building a C extension module, PyArg_ParseTuple, error handling, reference counting in C, and CFFI/ctypes alternatives.