Learn typing
Type hints for Python, checked by mypy and pyright, from basics to generics
The typing module and Python's annotation syntax let you describe the types your code expects, which static checkers such as mypy and pyright verify before the code runs. Hints power editor autocompletion and refactoring, document intent, and drive runtime tools like FastAPI and Pydantic. Learning typing well means catching bugs earlier and writing APIs that are clear to use.
Before you start
How deep do you want to go?
1. EssentialsRead and write simple code, do the everyday basics
2. PracticalUse it productively at work, with the usual idioms
3. AdvancedThe less common features, performance and trade-offs
4. ExpertInternals and the edge cases experts know