bytecode manipulation (byteplay) library for Python 3

pip install byteplay3==3.5.0



  • Originally created by Noam Raph
  • Original code archived and frozen at
  • This Repository automatically exported from

What it is

byteplay was a module that made it easy to tinker with the executable bytecode of a Python function in Python 2. The original code is still available from pypi ( and is still functional with Python 2.7.

This is byteplay3 which brings that capability to Python 3.4+.

For a full explanation with code examples see the new "about" file at

At this time byteplay3 is a work in progress.

Why Version 3.5.x?

I am setting the version number of byteplay3 to be the same as the highest level of Python against which it has been tested, plus a minor change number. Thus the current __version__ string is "3.5.0", first release tested on Python 3.5.

Why this fork?

I (tallforasmurf) would like to play with byteplay on Python 3, which the original does not support. I've made this fork (by export from to investigate the possibility of converting it to Python 3.

The file is my edited version for Python 3.