Support unavailable
Please try again later

Exploring CPython's bytecode

by Floris Bruynooghe for EuroPython 2011

The CPython interpreter always compiles your source code to bytecode, usually stored in .pyc files. This bytecode is then loaded and executed in the CPython virtual machine.

This talk will explore the bytecode from the outside in. Starting with how to read a .pyc file, following the steps the interpreter takes to arrive and a usable python module. It then dives into the structure of the bytecode itself and the principles of the virtual machine, detailing how the VM executes this bytecode to do useful work.

Having seen all these details you should have a good idea of the various innards of CPython and how to manipulate these to create weird, wonderful, dangerous and occasional useful hacks.



  1. Gravatar
    The slides actually contain a .tar.gz file, but the extension seems to have been lost during the upload.
  2. Gravatar
    The file is exploring-cpythons-bytecode.gz
    if I rename the download to exploring-cpythons-bytecode.tar.gz I get an archive containing only a directory named bytecode. This looks to be code examples for the presentation. However the real slides are nowhere to be found. Also the video torrent link is dead - so even if your presentation slides were interesting I would not be able to watch you.
  3. Gravatar
    The directory contains bytecode.s5.html which is the slideshow. The video is in the hands of the europython team and they asked to be patient as they try to get the missing bits together.

    (Sorry about the late reply, I have been on holiday for 2 weeks)

New comment

Download slide (None)
(Size: 72.2 KB)

60 minutes (inc Q&A)
Our Sponsors
Python Experts
SSL Matrix
Wanna sponsor?