mypy

A static type checker for Python that reads type hints and reports code whose types do not fit together, without running it.

In more detail

mypy file.py checks a file; errors come with line numbers, such as passing a str where an int is expected or forgetting that a function can return None. It is installed with pip and run before tests or in continuous integration.

Example

python -m pip install mypy
mypy wordcount.py

Related terms

Taught in

References