mypy Python's gradual typing implementation
summary
Mypy implements PEP 484/3107 implementation to add gradual typing to real codebases, catching wrong argument and assignment types before runtime while leaving Python behavior unchanged. It runs as an external CLI or in CI (used on a million+ lines at Dropbox), supports Python 3 annotations and Python 2 via comment syntax and --py2, provides typing, Any, Optional, type aliases, type inference, cast and reveal_type utilities, can ignore problematic C imports, and has basic PyCharm support and a web playground.
AI-written summary · about
chapters (25)
- 0:00Intro
- 1:09Agenda
- 1:30Hey Python, how would you describe yourself?
- 2:05Dynamic typing vs Static typing
- 4:11Can you guess the arguments types?
- 4:58What can we do? #2 attempt
- 6:36Dude - what is Gradual Typing?
- 8:39Docstrings + pytest + type hints
- 9:03Installing mypy
- 9:18Using Type Hints in python 3
- 10:32Invoking mypy
- 11:01Things to note
- 12:01This is what Static types
- 12:23Multi-line function annotations
- 13:02Built-in types - typing module
- 13:27Type aliases
- 15:16# type: ignore
- 16:03Covfefe Typing
- 16:21Type Inference
- 17:51Explicit Types
- 18:28reveal type
- 19:25Optional - document None is valid
- 20:01isinstance
- 20:54References
- 21:31That's it for today








