~/talk

A Bit about Bytes: Understanding Python Bytecode

Talkat PyCon 2018 · on Saturday, 2018-05-12· [python]
slides:none on file

Explains what lives in .pyc files (the co_consts, co_varnames, co_code fields), shows how to map raw bytes to opname entries like load_fast and how dis.dis prints human‑readable bytecode, demonstrates Python 3.6’s two‑byte instruction layout and even‑offsets, and gives concrete examples: using dis to find the exact instruction that raised an exception, and observing constant folding where literal arithmetic is evaluated at compile time so the runtime becomes a simple return.

AI-written summary · about

  1. 0:00Start
  2. 0:37Why Are We Here at Pycon
  3. 0:50Why Do We Love Python
  4. 5:52Python Bytecode
  5. 8:28Bytecode
  6. 14:33Evaluation Stack
  7. 14:53Block Stack
  8. 17:44Python Standard Library Documentation
  9. 19:53Stack Oriented Programming
  10. 23:05Specter
  11. 25:13Not all Bytecode Instructions Are Equally Expensive To Execute
  12. 25:26Micro Optimization
  13. 26:17General Guidelines
  14. 28:36Python Interpreter in Python
~/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.