Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python cross-version byte-code disassembler and marshal routines

Project Description

xdis

Cross-Python bytecode Disassembler and Marshal routines

Introduction

The Python dis module allows you to disassemble bytecode from the same version of Python that you are running on. But what about bytecode from different versions?

That’s what this package is for. It can “marshal load” Python bytecodes from different versions of Python. The command-line routine pydisasm will show disassembly output using Python 3.6 disassembly conventions.

It accepts bytecodes from Python version 1.5 to 3.6 or so. The code requires Python 2.4 or later and has been tested on Python running lots of Python versions.

To install versions for Python before 2.6 install via eggs or use the python-2.4 branch of git in github.

Installation

This uses setup.py, so it follows the standard Python routine:

pip install -r requirements.txt
pip install -r requirements-dev.txt
python setup.py install # may need sudo
# or if you have pyenv:
python setup.py develop

A GNU makefile is also provided so make install (possibly as root or sudo) will do the steps above.

Testing

make check

A GNU makefile has been added to smooth over setting running the right command, and running tests from fastest to slowest.

If you have remake installed, you can see the list of all tasks including tests via remake --tasks.

Usage

Run

./bin/pydisasm -h

for usage help.

As a drop-in replacement for dis

xdis also provides some support as a drop in replacement for the the Python library dis module. This is may be desirable when you want to use the improved API from Python 3.4 or later from an earlier Python version.

For example:

>>> # works in Python 2 and 3
>>> import xdis.std as dis
>>> [x.opname for x in dis.Bytecode('a = 10')]
['LOAD_CONST', 'STORE_NAME', 'LOAD_CONST', 'RETURN_VALUE']

There may some small differences in output produced for formatted disassembly or how we show compiler flags. We expect you’ll find the xdis output more informative though.

See Also

Release History

Release History

This version
History Node

3.6.3

History Node

3.6.2

History Node

3.6.1

History Node

3.6.0

History Node

3.5.5

History Node

3.5.4

History Node

3.5.3

History Node

3.5.2

History Node

3.5.1

History Node

3.5.0

History Node

3.4.0

History Node

3.3.1

History Node

3.3.0

History Node

3.2.4

History Node

3.2.3

History Node

3.2.2

History Node

3.2.1

History Node

3.2.0

History Node

3.1.0

History Node

3.0.2

History Node

3.0.1

History Node

3.0.0

History Node

2.3.2

History Node

2.3.1

History Node

2.2.3

History Node

2.2.2

History Node

2.2.1

History Node

2.2.0

History Node

2.1.0

History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.1.7

History Node

1.1.6

History Node

1.1.5

History Node

1.1.4

History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
xdis-3.6.3-py2.4.egg (163.9 kB) Copy SHA256 Checksum SHA256 2.4 Egg Dec 9, 2017
xdis-3.6.3-py2.5.egg (161.1 kB) Copy SHA256 Checksum SHA256 2.5 Egg Dec 9, 2017
xdis-3.6.3-py2.6.egg (151.6 kB) Copy SHA256 Checksum SHA256 2.6 Egg Dec 9, 2017
xdis-3.6.3-py26-none-any.whl (73.4 kB) Copy SHA256 Checksum SHA256 py26 Wheel Dec 9, 2017
xdis-3.6.3-py3.3.egg (155.3 kB) Copy SHA256 Checksum SHA256 3.3 Egg Dec 9, 2017
xdis-3.6.3-py33-none-any.whl (73.3 kB) Copy SHA256 Checksum SHA256 py33 Wheel Dec 9, 2017
xdis-3.6.3-py3.4.egg (154.7 kB) Copy SHA256 Checksum SHA256 3.4 Egg Dec 9, 2017
xdis-3.6.3-py34-none-any.whl (73.3 kB) Copy SHA256 Checksum SHA256 py34 Wheel Dec 9, 2017
xdis-3.6.3-py3.5-none-any.whl (73.3 kB) Copy SHA256 Checksum SHA256 py3.5 Wheel Dec 9, 2017
xdis-3.6.3-py3.6.egg (151.6 kB) Copy SHA256 Checksum SHA256 3.6 Egg Dec 9, 2017
xdis-3.6.3-py36-none-any.whl (73.3 kB) Copy SHA256 Checksum SHA256 py36 Wheel Dec 9, 2017
xdis-3.6.3.tar.gz (167.3 kB) Copy SHA256 Checksum SHA256 Source Dec 9, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting