Registry / dis3
library0.1.3pypypi✓ verified 85d ago

dis3 is a backport of Python 3.5+'s `dis` module to Python 2.7. It provides the inspection and bytecode disassembly functionality of CPython 3.5+ on legacy Python 2.7. Current version: 0.1.3. Release cadence is slow, primarily for compatibility use cases.

pip install dis3
INSTALL
IMPORT
SIG · DIS3
D
dis3
pythonv0.1.3
Install
1.5s avg
Import
10ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.002s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.002s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dis
from dis3 import dis
Import directly from dis3 to avoid shadowing the stdlib module.

Basic usage: import dis from dis3 and use it on a function to see bytecode instructions.

from dis3 import dis from dis3 import Bytecode, Instruction, CodeInfo def example(): x = 1 y = 2 return x + y dis(example)
Debug
Known issues
gotchaInstalling dis3 on Python 3 will import the stdlib `dis` but with version-based branching; it is designed for Python 2.7, not Python 3. Use the stdlib 'dis' on Python 3.
fix
Only use dis3 on Python 2.7. On Python 3, use `import dis` directly.
affects: all
deprecatedThe `CodeInfo` class and some instruction attribute names changed between Python versions; dis3 may not perfectly emulate Python 3.5+'s API in all edge cases.
fix
Test thoroughly if relying on specific bytecode attributes.
affects: 0.1.3
gotcha`Bytecode` class may have different iteration behavior than stdlib due to differences in Python 2 vs 3 bytecode.
fix
Refer to Python 2.7 dis documentation for expected behavior differences.
affects: all
Errors
Common errors & fixes
ImportError: No module named 'dis3'
Package not installed or running on Python 3 where it is not needed.
fix
Run `pip install dis3` on Python 2.7. On Python 3, use the built-in `dis` module.
Upgrade
Version history
0.1.3latest on PyPI · released Jan 14, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
dis3 — pip install dis3 · libregistry