~/talk

Exploring Python Code Objects

Talkat PyOhio 2012 · 2012-07-28..07-29· [compilers-and-language-design]
slides:none on file

CPython 2.7 actually compiles source to bytecode (about 148 opcodes), and the demo shows using compile() and exec on a source string, then reading co_code, co_names, constants and stack size and disassembling with the dis module. The bytecode for max and temp/out is stepped through, the VM loop in ceval.c and binary_add C path are inspected, exec is flagged slow and unsafe, closures show cellvars and func_closure, and the examples all run as shown.

AI-written summary · about

  1. 0:00Start
  2. 2:02CPYTHON
  3. 3:02BYTECODE?
  4. 4:38MAKE YOUR OWN
  5. 7:41MAKE IT GO
  6. 11:32UNDER THE HOOD
  7. 18:23CEVAL.C
  8. 21:54CLASSES ARE CODE, TOO
  9. 23:54CLOSURES
  10. 53:14ZOOMING OUT
~/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.