{"id":23543,"library":"dis3","title":"dis3","description":"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.","status":"active","version":"0.1.3","language":"python","source_language":"en","source_url":"https://github.com/KeyWeeUsr/python-dis3","tags":["dis","bytecode","backport","python2","disassembly"],"install":[{"cmd":"pip install dis3","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Import directly from dis3 to avoid shadowing the stdlib module.","symbol":"dis","correct":"from dis3 import dis"}],"quickstart":{"code":"from dis3 import dis\nfrom dis3 import Bytecode, Instruction, CodeInfo\n\ndef example():\n    x = 1\n    y = 2\n    return x + y\n\ndis(example)","lang":"python","description":"Basic usage: import dis from dis3 and use it on a function to see bytecode instructions."},"warnings":[{"fix":"Only use dis3 on Python 2.7. On Python 3, use `import dis` directly.","message":"Installing 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Test thoroughly if relying on specific bytecode attributes.","message":"The `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.","severity":"deprecated","affected_versions":"0.1.3"},{"fix":"Refer to Python 2.7 dis documentation for expected behavior differences.","message":"`Bytecode` class may have different iteration behavior than stdlib due to differences in Python 2 vs 3 bytecode.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install dis3` on Python 2.7. On Python 3, use the built-in `dis` module.","cause":"Package not installed or running on Python 3 where it is not needed.","error":"ImportError: No module named 'dis3'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}