Miscellaneous strictness flags
allow_untyped_globals
(bool, default False)- Causes mypy to suppress errors caused by not being able to fullyinfer the types of global and class variables.
allow_redefinition
(bool, default False)- Allows variables to be redefined with an arbitrary type, as long as the redefinitionis in the same block and nesting level as the original definition.
implicit_reexport
(bool, default True)- By default, imported values to a module are treated as exported and mypy allowsother modules to import them. When false, mypy will not re-export unlessthe item is imported using from-as or is included in
all
. Note that mypytreats stub files as if this is always disabled. For example:
- # This won't re-export the value
- from foo import bar
- # This will re-export it as bar and allow other modules to import it
- from foo import bar as bar
- # This will also re-export bar
- from foo import bar
- __all__ = ['bar']
strict_equality
(bool, default False)- Prohibit equality checks, identity checks, and container checks betweennon-overlapping types.