Introduction Introduction Mypy is a static type checker for Python 3 and Python 2.7. If you sprinkleyour code with type annotations, mypy can type check your code and find comm...
Incremental mode Incremental mode These options may only be set in the global section ([mypy] ). incremental (bool, default True) Enables incremental mode . cache_dir (stri...
Function signatures and dynamic vs static typing Function signatures and dynamic vs static typing A function without type annotations is considered to be dynamically typed by m...
Continuous Integration Continuous Integration Once you have a clean mypy run and a runner script for a partof your codebase, set up your Continuous Integration (CI) system toru...
High-level overview High-level overview Every entry point function should accept a single string argumentthat is a full mypy version and return a subclass of mypy.plugin.Plugin...
When you’re puzzled or when things are complicated When you’re puzzled or when things are complicated from typing import Union , Any , List , Optional , cast # T...
Miscellaneous strictness flags Miscellaneous strictness flags This section documents any other flags that do not neatly fall under anyof the above sections. —allow-untyped-gl...
Function overloading Runtime behavior Type checking calls to overloads Type checking the variants Type checking the implementation Function overloading Sometimes the argume...
Check the target of NewType [valid-newtype] Check the target of NewType [valid-newtype] The target of a NewType definition must be a class type. It can’tbe a union type, Any ...
Next steps Next steps If you are in a hurry and don’t want to read lots of documentationbefore getting started, here are some pointers to quick learningresources: Read the my...