mypy

Static type checker for Python code

brewmacoslinux
Try with needOr install directly
Source

About

Experimental optional static type checker for Python

Commands

mypy

Examples

check python file for type errors$ mypy script.py
check entire project directory for type issues$ mypy src/
generate type checking report with detailed output$ mypy --html report myproject/
check code and show all error details$ mypy --show-error-codes --pretty script.py
validate types in python package$ mypy --strict mypackage/