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.

Level: intermediateTopic: Python advanced

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.