# mypy

*noun*

say it: **“MY-py”** **/ˈmaɪˌpaɪ/**

A tool that reads Python code and its type hints without running it, and reports places where a value doesn't match its hint, such as text passed where a number is expected.

## What is `mypy`?

`mypy` is a tool that reads your type hints and warns you about type mistakes before you run the code.

```python
# shop.py
def total(price: float, qty: int) -> float:
    return price * qty

total("9.99", 2)

# mypy shop.py
# error: Argument 1 to "total" has incompatible type "str"; expected "float"
```

## In a sentence

- “The team runs **mypy** before every commit, next to the tests.”
- “**mypy** caught that total("9.99", 2) passed a string where a float was expected.”

Level: Freelancer · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=4)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/mypy
