| abi3 | The wheel and filename tag for a binary built against the Limited API, loadable by every CPython from a declared minimum version upward. Not available for free-threaded builds. | L09 |
| Abstract API | The PyObject_*, PyNumber_*, PySequence_*, PyMapping_* layer, which dispatches through the object's type and can therefore execute arbitrary Python code. | L01 |
| Argument Clinic | CPython's preprocessor that turns a declarative signature into a fast keyword parser, a docstring, and an introspectable signature. | L06 |
| Attached / detached | Modern terminology for whether a thread's PyThreadState is installed and (on GIL builds) the GIL held. "Detached" replaces "released the GIL", because detaching still matters without a GIL. | L10 |
| Biased reference counting | The free-threaded build's scheme: a non-atomic local count owned by one thread plus an atomic shared count for the others. Makes Py_REFCNT no longer a single readable integer. | L11 |
| Borrowed reference | A pointer to an object that someone else is keeping alive. You must not decref it, and it is valid only as long as that owner keeps it. | L02 |
| Buffer protocol | PEP 3118. Lets an object expose its flat memory block to C directly, with no copy, while pinning the address for the lifetime of the view. | L12 |
Capsule (PyCapsule) | A Python object wrapping a void * with a name and optional destructor. The name is a type check. Used to pass opaque pointers and to export a C API between extensions. | L13 |
| Code object | The immutable compiled unit — bytecode, constants, names — created once per function definition and shared by every call. | L07 |
| Concrete API | Type-specific functions such as PyLong_* and PyList_*. Faster than the abstract layer, but you must verify the type first. | L01 |
| Critical section | Py_BEGIN_CRITICAL_SECTION / ..._SECTION2. Locks one or two Python objects' internal mutexes. The lock is suspended if the enclosed code blocks; at most two objects. | L11 |
| Cycle collector | The generational tracing collector that reclaims unreachable reference cycles, which plain reference counting cannot. Finds them by subtracting internal references. | L04 |
| Deferred reference counting | Skipping refcount updates for functions, code objects, modules and types on the interpreter stack. Their true count is only knowable during a collection pause. | L11 |
defining_class | The class in which a method was defined, supplied by the METH_METHOD convention. The correct way for a heap-type method to reach module state, since Py_TYPE(self) may be a Python subclass. | L08 |
| Dunder | A "double underscore" special method name such as __add__. The Python-visible spelling of a C slot. | L03 |
| Error indicator | Per-thread state holding the exception currently in flight. Must be set exactly when a C function returns its error sentinel. | L05 |
| Eval loop | _PyEval_EvalFrameDefault, the C function that executes bytecode. Its internals change every release; the public API is what stays stable. | L07 |
EXT_SUFFIX | The platform- and version-specific filename suffix for an extension, e.g. .cp314-win_amd64.pyd. Encodes the compatibility contract. | L09 |
| Format unit | One character (or pair) in a PyArg_ParseTuple format string describing one argument's conversion. Units such as s, y, O yield borrowed pointers; s*, y*, w* yield a Py_buffer you must release. | L06 |
| Frame | The per-call runtime state: locals, value stack, instruction offset, link to the caller. Since 3.11 the PyFrameObject is materialized lazily. C functions get no frame. | L07 |
| Free-threaded build | The GIL-less CPython build (python3.14t, Py_GIL_DISABLED). Officially supported since 3.14, not the default, and a distinct ABI. | L11 |
| GIL | Global interpreter lock: the per-interpreter mutex a thread must hold to execute bytecode or call almost any C API function. | L10 |
| Heap type | A type created at runtime from a PyType_Spec, owned by a module instance. Can reach module state, works under subinterpreters, required by the Limited API. | L03 |
| Immortal object | An object whose refcount is pinned so incref/decref are no-ops: None, True, False, small ints, interned strings, static types (PEP 683). | L01 |
| Limited API | The documented C API subset that avoids layout-dependent macros, enabled with #define Py_LIMITED_API. Its binary counterpart is the stable ABI. | L09 |
m_size | PyModuleDef field giving the size of per-module state. 0 for none, positive for a state struct, -1 for legacy C globals. | L08 |
m_traverse / m_clear / m_free | The module-level equivalents of tp_traverse/tp_clear/deallocation. Required when module state holds PyObject *. | L08 |
METH_ flags | Calling conventions in PyMethodDef: METH_NOARGS, METH_O, METH_VARARGS, METH_KEYWORDS, METH_FASTCALL, METH_METHOD, plus METH_CLASS/METH_STATIC/METH_COEXIST. | L06 |
| mimalloc | The thread-safe allocator that replaces pymalloc in free-threaded builds, with segregated heaps that make mixing allocator families fatal. | L11 |
| Module state | A struct allocated per module instance, reachable with PyModule_GetState. Replaces C globals so that subinterpreters and reloads work. | L08 |
| MRO | Method resolution order: the linearized base-class sequence computed by PyType_Ready, used to inherit unset slots. | L03 |
| Multi-phase initialization | PEP 489. PyInit_x returns a module definition; the import machinery creates the module and calls your Py_mod_exec. Prerequisite for isolation. | L08 |
| New reference | Synonym for a strong reference returned to you by a function; you own one decref. | L02 |
Py_buffer | The struct describing an exported memory block: pointer, exporter, length, itemsize, format, shape, strides. Must be released with PyBuffer_Release. | L12 |
Py_BEGIN_ALLOW_THREADS | Macro pair expanding to PyEval_SaveThread/PyEval_RestoreThread. Detaches the thread state around work that touches no Python object. | L10 |
Py_CLEAR | Sets a field to NULL before decrefing the old value, so code re-entered by the deallocator never sees a dangling pointer. | L02 |
Py_EnterRecursiveCall | Opt-in recursion guard for C code, which otherwise consumes no Python frames and can overflow the native stack instead of raising RecursionError. | L07 |
Py_GIL_DISABLED | Preprocessor macro defined in free-threaded builds. On Windows from 3.14 the build backend must define it explicitly. | L11 |
Py_mod_gil | Module slot declaring whether the module needs the GIL. Py_MOD_GIL_NOT_USED is an unverified promise of thread safety; without it a free-threaded interpreter re-enables the GIL process-wide. | L11 |
Py_ssize_t | Signed integer the width of size_t, used for every length, index and count so that -1 can mean error (PEP 353). | L01 |
Py_TPFLAGS_HAVE_GC | Type flag declaring participation in cycle collection. Requires tp_traverse. | L04 |
Py_VISIT | Macro used inside tp_traverse: NULL-checks the field, calls visit, and returns early on a non-zero result. | L04 |
PyErr_GetRaisedException | Modern (3.12+) way to take the in-flight exception out and put it back with PyErr_SetRaisedException. Replaces PyErr_Fetch/Restore. | L05 |
PyGILState_Ensure | Attaches the current thread, creating a thread state if needed. The way a foreign thread enters Python. Unsafe during finalization. | L10 |
PyInit_<name> | The single symbol the import machinery looks up in a loaded shared library. Must match the last component of the module name. | L08 |
PyInterpreterState | Per-interpreter state: module table, builtins, import machinery, the GIL. More than one exists when subinterpreters are in use. | L10 |
PyMethodDef | The struct that exposes a C function to Python: name, function pointer, calling convention, docstring. | L06 |
PyModuleDef | The static description of a module: name, docstring, state size, methods, slots, and GC hooks. | L08 |
PyMutex | One-byte lock added in 3.13 that detaches the thread state while waiting, which removes the classic GIL/lock deadlock. Zero-initialize; never copy. | L10 |
PyObject | The universal object header: a reference count and a type pointer. Every Python value begins with one. | L01 |
PyObject_HEAD | Macro placing a PyObject as the first member of your instance struct, making the pointer cast to PyObject * valid. | L01 |
PyThreadState | Per-thread interpreter state: current frame, exception state, recursion depth, tracing hooks. | L10 |
PyTypeObject | The C struct behind a Python class: mostly function pointers (slots), plus size and flag fields. | L03 |
PyType_Spec / PyType_Slot | The data-driven description of a heap type, passed to PyType_FromModuleAndSpec. The only way to define a type under the Limited API. | L03 |
PyVarObject | Header for variable-length objects, adding ob_size. Used by tuples, strings and ints. | L01 |
| Reentrancy | The property that any call which can run Python code can re-enter your own code. Forces you to leave data structures consistent before every such call. | L02 |
| Reference count | ob_refcnt: how many places currently hold a valid pointer to the object. At zero, the deallocator runs. | L02 |
| Sentinel | The error return value: NULL for PyObject *, -1 for int and Py_ssize_t. Ambiguous for conversions where -1 is a valid result. | L05 |
| Slot | A function-pointer field in PyTypeObject implementing one behaviour, such as tp_repr or nb_add. The real mechanism behind dunder methods. | L03 |
| Stable ABI | The binary contract corresponding to the Limited API: symbols guaranteed compatible across CPython 3.x releases. Tagged abi3. | L09 |
| Static type | A PyTypeObject declared in static storage and readied with PyType_Ready. One per process; cannot reach module state; not usable with the Limited API. | L03 |
| Stealing a reference | A function taking over ownership of a reference you pass in, so you must not decref afterwards. PyTuple_SetItem, PyList_SetItem, Py_BuildValue's N. | L02 |
| Strong reference | A reference whose count was incremented for you. The object is guaranteed alive; you owe exactly one decref. | L02 |
| Subinterpreter | An additional PyInterpreterState in the same process, optionally with its own GIL (PEP 684). Requires extensions with no PyObject * globals. | L08 |
tp_alloc / tp_free | The type's allocator and deallocator for instance memory. Always call through the instance's own type so subclasses work. | L03 |
tp_clear | Drops the instance's object references to break a cycle. Must be idempotent, must use Py_CLEAR, must not release foreign resources. | L04 |
tp_dealloc | Runs when the refcount reaches zero. Order: untrack, clear fields, tp_free, then decref the type for heap types. | L03 |
tp_finalize | The slot behind __del__. Runs once, before deallocation, while the object is still valid. Where user-visible cleanup belongs. | L04 |
tp_init / tp_new | Two-phase construction: tp_new allocates and returns an instance, tp_init applies arguments and may run again or never. | L03 |
tp_iternext | The iterator slot. Returning NULL with no exception set means exhausted. | L07 |
tp_traverse | Enumerates the object references this instance owns, for the cycle collector. Must be pure: no allocation, no Python code, no raising. | L04 |
| Unraisable exception | An exception raised where there is no caller to receive it — inside a deallocator or a C callback. Report it with PyErr_FormatUnraisable, which routes to sys.unraisablehook. | L05 |
| Vectorcall | PEP 590. A calling protocol passing a pointer to a contiguous argument array plus a count, avoiding the tuple allocation of METH_VARARGS. | L06 |
| Wheel tag | The compatibility triple in a wheel filename, e.g. cp314-cp314t-manylinux_2_28_x86_64. The t marks a free-threaded build. | L09 |