Compile type annotated Python to fast C extensions
Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code. Mypyc uses mypy to perform type checking and type inference.
Mypyc can compile anything from one module to an entire codebase. The mypy project has been using mypyc to compile mypy since 2019, giving it a 4x performance boost over regular Python.
typing
moduleDocumentation is available at ReadTheDocs.
We track the performance of mypyc using several benchmarks. Results are updated daily to make it easy to track progress.
The mypyc issue tracker lives in this repository. You can also ask questions in our Gitter chat.
cpdef
, or
extra decorators, with good performance.These are our near-term focus areas for improving mypyc:
... and better performance (always!).
We are actively looking for early adopters! Mypyc is currently alpha software. It's only recommended for production use cases with careful testing, and if you are willing to contribute fixes or to work around issues you will encounter.
New contributors are very welcome! Any help in development, testing, documentation and benchmarking tasks is highly appreciated.
Useful links for contributors:
The code lives in the mypyc subdirectory of the mypy repository.
We have developer documentation.
Use the issue tracker to find things to work on.
You can ask questions in our Gitter chat.
Follow our updates on the mypy blog: https://mypy-lang.blogspot.com/
Mypyc and mypy are licensed under the terms of the MIT License, with portions under the Python Software Foundation license (see the file LICENSE in the mypy repository).