A static type checker for Python and a compiler for type-annotated Python
Mypy can find many classes of bugs automatically, improving the quality of your code. Perhaps more importantly, type annotations act as machine-checked documentation and make your code easier to understand and maintain. Mypy can scale to multi-million line codebases, while providing quick incremental checking through the mypy daemon.
Mypy lets you freely mix type checked and unannotated code, making it possible to gradually migrate existing codebases to static type checking.
What is mypyc?
Mypyc is a compiler from a type annotated Python dialect to CPython C extension modules that uses mypy as the front end. It can often significantly speed up Python code. We originally built mypyc to compile mypy, making mypy 4x faster. We are now looking at making mypyc useful for end users as a practical tool to make Python programs and libraries more efficient.
It's easy to ensure that programs compiled with mypyc continue to also be valid (non-compiled) Python programs. Modules compiled with mypyc can freely interact with interpreted modules. Mypyc lets you compile a few performance-sensitive modules and keep the rest of your program interpreted.
mypy 2021 Projects
Improve support for singledispatchCurrently, mypy and mypyc are unable to recognize uses of the singledispatch decorator, making mypy generate false positives and mypyc generate...
Speeding up string operations of MypycMypyc is a compiler from type-annotated Python to CPython C extension modules. It uses type information and restrictions to certain dynamic language...