Welcome to Mypy documentation!¶
Mypy is a static type checker for Python 3 and Python 2.7.
- Common issues and solutions
- Can’t install mypy using pip
- No errors reported for obviously wrong code
- Spurious errors and locally silencing the checker
- Unexpected errors about ‘None’ and/or ‘Optional’ types
- Mypy runs are slow
- Types of empty collections
- Redefinitions with incompatible types
- Invariance vs covariance
- Declaring a supertype as variable type
- Complex type tests
- Python version and system platform checks
- Displaying the type of an expression
- Import cycles
- Silencing linters
- Covariant subtyping of mutable protocol members is rejected
- Dealing with conflicting names
- I need a mypy bug fix that hasn’t been released yet
- Supported Python features
- New features in Python 3.6
- Additional features
- Frequently Asked Questions
- Why have both dynamic and static typing?
- Would my project benefit from static typing?
- Can I use mypy to type check my existing Python code?
- Will static typing make my programs run faster?
- How do I type check my Python 2 code?
- Is mypy free?
- Can I use duck typing with mypy?
- I like Python and I have no need for static typing
- How are mypy programs different from normal Python?
- How is mypy different from Cython?
- Mypy is a cool project. Can I help?
- Revision history