mypyc
Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code.
Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code.
To install this package, run one of the following:
The compiled language is a strict, gradually typed Python variant. It restricts the use of some dynamic Python features to gain performance, but it's mostly compatible with standard Python.
Mypyc uses mypy to perform type checking and type inference. Most type system features in the stdlib typing module are supported.
Compiled modules can import arbitrary Python modules and third-party libraries. You can compile anything from a single performance-critical module to your entire codebase. You can run the modules you compile also as normal, interpreted Python modules.
Existing code with type annotations is often 1.5x to 5x faster when compiled. Code tuned for mypyc can be 5x to 10x faster.
Mypyc currently aims to speed up non-numeric code, such as server applications. Mypyc is also used to compile itself (and mypy).
Summary
Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code.
Information Last Updated
Mar 25, 2025 at 16:22
License
MIT
Total Downloads
15
Platforms
GitHub Repository
https://github.com/python/mypy/blob/master/mypyc