Mypy

With Mypy you can do a static type check.

Installation

Mypy requires Python≥3.5. Then it can be installed, for example with:

$ uv add mypy

Check

Then you can check it, for example with:

$ uv run mypy myprogram.py

Note

Although Mypy needs to be installed with Python3, it can also parse Python2 code, for example with:

$ uv run mypy --py2 myprogram.py