~/talk

Exploring CPython's bytecode

Talkat EuroPython 2011 · 2011-06-20..06-26· [python, compilers-and-language-design]
slides:none on file

Shows how to read a .pyc header and do a magic number check, parse a code object’s constants, names and bytecode, and then trace the actual opcodes byte by byte. Builds a tiny frame-based executor that implements LOAD_FAST / STORE_FAST, MAKE_FUNCTION/CALL_FUNCTION and basic comparisons and jumps, demonstrating function creation, argument handling and call/return behavior. Explains the postcompile step that converts assigned names into fast locals rather than globals.

AI-written summary · about

  1. 0:00CPython bytecode intro
  2. 8:51Bytecode file format
  3. 15:12Code objects structure
  4. 22:12Loading variables & calls
  5. 31:16Simple ops & operators
  6. 35:42Compilation steps
  7. 41:20Power function args
  8. 46:25Coverage & bytecode mod
  9. 47:34Q&A special methods
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.