32. Method Calls
LOAD_METHOD and CALL_METHOD optimization, bound method objects, and the method cache.
13 notes
LOAD_METHOD and CALL_METHOD optimization, bound method objects, and the method cache.
The main evaluation loop in Python/ceval.c, opcode dispatch via computed gotos, and the eval breaker mechanism.
MAKE_CELL, LOAD_DEREF, STORE_DEREF opcodes and the PyCellObject that captures variables in enclosing scopes.
How list/dict/set comprehensions and generator expressions compile to nested code objects with implicit iteration.
match/case compilation to MATCH_* opcodes, pattern semantics, and guard evaluation in the interpreter.
async def, await, SEND opcode, coroutine wakeup, and how asyncio integrates with CPython's coroutine machinery.
Generator object internals, YIELD_VALUE and RESUME opcodes, and frame suspension and resumption mechanics.
Exception tables, the try/except/finally bytecode pattern, exception chaining, and the unwinding protocol.
LOAD_ATTR bytecode, __getattribute__ dispatch, the descriptor protocol, and type version tag caching.
CALL opcode mechanics, positional and keyword argument handling, *args/**kwargs unpacking, and call overhead.
Catalogue of CPython opcodes: LOAD/STORE variants, binary ops, comparison, jumps, and call instructions.
The value stack, operand push/pop discipline, and how the interpreter maintains stack depth invariants.
PyFrameObject and _PyInterpreterFrame layout, frame creation, the frame stack, and frame introspection.