This release is a pre-release and may not be stable for production use.
cdis - a consistent Python disassembler
Important
The cdis bytecode format will not be considered stable until the 1.0.0 release.
The 0.x.y releases may have breaking changes in both the bytecode and the API exposed.
What is it?
cdis, pronounced "see this", is a Python disassembler that produce consistent results across Python versions. CPython bytecode is neither forward or backwards compatible, so it outputs bytecode for the "cdis Virtual Machine", which when executed, has the exact same behaviour as CPython's bytecode.
Why would I use it?
- To write a Python compiler to any language of your choice
- To determine what symbols a function uses
- As a compiler target to generate Python code from another language
Known differences with CPython
- Different behaviour of
locals()inside list comprehensions. In particular, we use a synthetic variable for the iterator variable instead of reusing the name. CPython changed the behaviour oflocals()in list comprehension in 3.12, so this is undefined behaviour. - Different behaviour of when match variables are bound.
Technically, Python allows binding even when subpatterns fail.
That being said, CPython does appear to have consistent behaviour of delaying
binding until all subpatterns succeed.
As such, a future version of
cdiswill probably match CPython behaviour.
Missing features
- User customizable optimization passes (Planned)
- User customizable VM tracer (Planned)
- A guide on how to actually use
cdis(Planned).
Run tests
Install test dependencies
pip install "pytest>8" "coverage" "tox"
pip install -e .
Run tests on current python version
pytest
Metadata
Release files for cdis 0.0.1a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cdis-0.0.1a0.tar.gz | 69.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cdis-0.0.1a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 137.2 kB
Release files / cdis-0.0.1a0.tar.gz
| Download URL | cdis-0.0.1a0.tar.gz |
|---|---|
| Size | 69.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b30933e6f4a0518b0afcc25dc0073828bd226d49650fa675b45caeb6600deafe
|
|
BLAKE2b-256 checksum How to use checksums |
1ab7d646e6b3c98d087e3f95a2f463212fde07ff92d83d242a94c8f9a929a6ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logRelease files / cdis-0.0.1a0-py3-none-any.whl
| Download URL | cdis-0.0.1a0-py3-none-any.whl |
|---|---|
| Size | 67.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b96dae7c00e9a11e1f5fbbefcf73f3cbd93fabebd59f972a7d0878e8225608a1
|
|
BLAKE2b-256 checksum How to use checksums |
0f3da11a0dd4380bdc4343620659cb954a796fefdd2f58764758be5b47b261ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logSecurity for cdis 0.0.1a0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cdis-0.0.1a0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.