Type Checker
PronunciationTYPE CHEK-er
Definition
A type checker reads your code and its type hints and reports type mistakes, such as passing a string where a number is expected, without running the program.
Where you hear it
In CI checks, Python projects that use mypy or pyright, and TypeScript builds.
Examples
CI runs the type checker and fails on any error.
The type checker caught that
Nonecan reach this line.The type checker reports that the price may be undefined in the cart total.
Common mistake
Thinking it enforces types at runtime. In Python the hints are not checked when the program runs.
Don't confuse with
A linter, which looks for style problems and likely bugs. A type checker specifically verifies types.
Say it at work
- In a meeting or chat
Fix the type checker errors before merging.
- In an email or ticket
Run mypy in strict mode on the new module.
Keep exploring
More in Testing & Quality