Untyped definitions and calls

The following flags configure how mypy handles untyped functiondefinitions or calls.

  • —disallow-untyped-calls
  • This flag reports an error whenever a function with type annotationscalls a function defined without annotations.
  • —disallow-untyped-defs
  • This flag reports an error whenever it encounters a function definitionwithout type annotations.
  • —disallow-incomplete-defs
  • This flag reports an error whenever it encounters a partly annotatedfunction definition.
  • —check-untyped-defs
  • This flag is less severe than the previous two options – it type checksthe body of every function, regardless of whether it has type annotations.(By default the bodies of functions without annotations are not typechecked.)

It will assume all arguments have type Any and always infer Anyas the return type.

  • —disallow-untyped-decorators
  • This flag reports an error whenever a function with type annotationsis decorated with a decorator without annotations.