~/talk

CPython internals and the VM

Talkat PyCon AU 2016 · 2016-08-12..08-16· [python, compilers-and-language-design]
slides:none on file

Shows CPython as a stack‑based VM: dis produces bytecode that pushes args, runs BINARY_ADD, stores and reloads values and returns; there is no optimization and no type info. The main loop lives in PyEval_EvalFrameEx and dispatches opcodes. Startup walks Modules/python.c → Py_Initialize → many PyType_Ready calls to init builtins, seeds hash randomization from /dev/urandom then a linear‑congruential RNG, and bootstraps user code via the runpy module ultimately invoked with PyObject_Call; a crafted test even causes a segfault at 87317 variables.

AI-written summary · about

  1. 0:00Start
  2. 0:04Christopher Swenson
  3. 0:52What Happens When C Python Starts Up
  4. 3:03C Python Vm
  5. 7:39Main Loop
  6. 10:47Startup
  7. 11:46Hash Randomization
  8. 13:59Linear Congruential Random Number Generator
  9. 17:38Python Thread States
  10. 22:02Calculate the Method Resolution Order
  11. 24:02Checks for the Verbose Flag
  12. 25:36Run Module Main
  13. 29:13Reading the Python Code
  14. 31:16Pi Frame
~/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.