mypy Plugin
Python static type checker (PEP 484).
Commands
Check
mypy check run— Type-check Python filesmypy check strict— Type-check with strict mode
Usage Examples
- "Type-check this Python file"
- "Find type errors in my project"
- "Run strict type checking"
- "Verify type annotations"
Installation
pip install mypy
Examples
# Basic type check
mypy mymodule.py
# Check a package
mypy mypackage/
# Strict mode
mypy --strict mymodule.py
# With config
mypy --config-file mypy.ini mymodule.py
# Ignore missing imports
mypy --ignore-missing-imports mymodule.py
# Strict optional
mypy --strict-optional mymodule.py