static type checking

Checking that values are used consistently with their declared types by analysing code without running it.

In more detail

Tools such as mypy for Python and the TypeScript compiler read type annotations and report mismatches before the code runs. Annotations usually have no effect at run time; only the checker reads them.

Examples

In Python the usual static type checker is mypy.
In this course: In Python, tools such as mypy or Pyright read type hints and report mismatches before tests even run, which makes them a fast first layer in a quality gate. Type hints do nothing at run time; only the checker reads them.

Related terms

Taught in

References