Skip to main content

Python module to modify bytecode

Project description

bytecode is a Python module to modify bytecode.

The API is unstable. The project is closer to a proof-of-concept (PoC).

A code object is made of blocks and a block is a list of instructions. An instruction has 3 main attributes: lineno, name, arg. Jumps use labels to blocks, each block object has an unique label.

It’s possible to get a flat code with only one block and without labels: use Code.disassemble(code, use_labels=False).

bytecode 0.0 has been written to reimplement the CPython 3.6 peephole optimizer in pure Python. This version only supports Python 3.6.



  • 2016-02-23: Release 0.0
    • First public release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bytecode, version 0.0
Filename, size File type Python version Upload date Hashes
Filename, size bytecode-0.0-py3-none-any.whl (6.0 kB) File type Wheel Python version 3.4 Upload date Hashes View
Filename, size bytecode-0.0.tar.gz (7.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page