Change the future

Saturday 4:15 p.m.–5 p.m.

All-Singing All-Dancing Python Bytecode

Larry Hastings

Audience level:
Core Python (Language, Stdlib)


We all know Python is a bytecode interpreter, but what does that mean? Come find out! You'll learn what Python bytecodes are, what they do, and even how you can tinker with them. By the end of the talk you'll be an expert. All code will be 100% Python 3--knowledge of C not required!


The talk will examine Python bytecodes in depth--the families of bytecodes, how and why they are the way they are, and what some specific Python blocks look like when translated to bytecode.

To facilitate the discussion, I'll unveil a Python bytecode disassembler, a matching Python bytecode assembler, and even a (very!) simple Python bytecode interpreter, all written in Python 3.3. Talk will also demonstrate a simple FORTH written in a combination of Python and bytecode assembly. All source code will be made available at the end of the talk under an open source license.