Tutorial sequence

Identity, Memory, and Lifetime

5of 5 published
  1. 01

    advanced / 30 min

    Names are references, but that slogan is not enough

    Build a precise model of binding, mutation, copying, argument passing, closure cells, identity, and API ownership.

    Read
  2. 02

    advanced / 33 min

    Reference counting and cyclic garbage collection

    Build a precise model of CPython object lifetime, cycles, finalizers, weak references, and the diagnostics that can accidentally keep objects alive.

    Read
  3. 03

    advanced / 32 min

    Inside CPython's allocator

    Connect Python allocations to pymalloc arenas, pools, blocks, process RSS, tracemalloc domains, and responsible measurement.

    Read
  4. 04

    advanced / 30 min

    Weak references and caches that can let go

    Use weak references, weak containers, and finalizers without confusing reachability, equality, callbacks, or cache policy.

    Read
  5. 05

    advanced / 31 min

    Finalization is where simple models fail

    Design reliable cleanup around context managers, finalizers, cycles, resurrection, shutdown, async cancellation, and process exit.

    Read