Type Checker
noun
say it: “TYPE CHEK-er” /ˈtaɪp ˈtʃɛkər/
A tool that reads a program without running it and points out places where a value's type doesn't match what the code says it should be.
What is a type checker?
A type checker reads your code without running it and reports each place where a value can't be the type it's supposed to be, such as text passed where a number is expected. mypy checks Python code this way.
def membership_fee(months: int) -> float:
return months * 29.99
membership_fee("12")
# mypy: error: Argument 1 to "membership_fee" has incompatible type "str"; expected "int"
In a sentence
- “Running the type checker on every push stops type mix-ups before they're merged.”
- “The type checker caught a string being passed as the number of months.”
Level: Journeyman · More Software Development terms at this level
Updated