Welcome to Mypy documentation! Indices and tables Welcome to Mypy documentation! Mypy is a static type checker for Python 3 and Python 2.7. First steps First steps Introdu...
The Any type The Any type A value with the Any type is dynamically typed. Mypy doesn’t knowanything about the possible runtime types of such value. Anyoperations are permitted...
Platform configuration Platform configuration By default, mypy will assume that you intend to run your code using the sameoperating system and Python version you are using to r...
Spurious errors and locally silencing the checker Spurious errors and locally silencing the checker You can use a # type: ignore comment to silence the type checkeron a partic...
Local type inference Local type inference Once you have added type hints to a function (i.e. made it statically typed),mypy will automatically type check that function’s body. ...
Specifying code to be checked Specifying code to be checked Mypy lets you specify what files it should type check in severaldifferent ways. First, you can pass in paths to Py...
Import cycles Import cycles An import cycle occurs where module A imports module B and module Bimports module A (perhaps indirectly, e.g. A -> B -> C -> A ).Sometimes in order ...
Report generation Report generation If these options are set, mypy will generate a report in the specifiedformat into the specified directory. any_exprs_report (string) Caus...
Check that types have no Any components due to missing imports [no-any-unimported] Check that types have no Any components due to missing imports [no-any-unimported] If you use...
Complex type tests Complex type tests Mypy can usually infer the types correctly when using isinstance type tests, but for other kinds of checks you may need to add anexplicit...