AI engineering glossary · Python advanced
What is mypy?
mypy: A static type checker for Python that reads type hints and reports type mismatches without running the program. It catches bugs early, especially in larger codebases and CI pipelines. It is commonly run as a step in continuous integration checks.
mypy: an example
Running mypy on a file that calls total('abc') flags that a string was passed where list[float] was expected.
Related terms
- Type hint
- Static analysis
- Pyright
- CI pipeline
More Python advanced terms
Where you learn it
mypy is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.