Tutorial sequence

From Source Code to Running Frame

6of 6 published
  1. 01

    advanced / 31 min

    What compile() actually produces

    Follow Python source through ASTs and code objects, then watch execution supply the frame and namespaces that compiled code does not contain.

    Read
  2. 02

    advanced / 31 min

    Reading bytecode without cargo culting it

    Use disassembly as versioned evidence, connect stack operations to source semantics, and avoid turning CPython opcodes into false contracts.

    Read
  3. 03

    advanced / 32 min

    Frames, locals, globals, and builtins

    Trace Python name resolution through live frames, fast locals, module globals, builtins, and the namespace rules around exec.

    Read
  4. 04

    advanced / 30 min

    Closures capture cells, not frozen values

    Understand late binding, shared nonlocal state, loop callbacks, and the CPython cells underneath lexical closures.

    Read
  5. 05

    advanced / 31 min

    Function calls and vectorcall

    Separate Python call semantics from CPython vectorcall, then design APIs that avoid needless argument and boundary overhead.

    Read
  6. 06

    advanced / 33 min

    Exceptions are control flow with machinery

    Follow exceptions through matching, unwinding, chaining, cleanup, exception groups, and CPython 3.14 exception tables.

    Read