Duck Typing Is For The Birds
summary
Introduces practical static typing for Python with concrete code: annotated variables and functions, a distance example that fails when passed strings, and tools that actually catch errors. Demonstrates MonkeyType auto-generates annotations by using sys.setprofile to record calls into a SQLite DB and applying stubs via retype. Runs both mypy and Pyre, notes mypy is more consistent and has ~1,600 dependent projects while Pyre is faster but flaky and OS-limited. Recommends starting small, using IDE plugins, and enforcing checks in CI.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:09What is static typing
- 3:39What is dynamic typing
- 6:54Static typing examples
- 8:27Coding examples
- 13:22Pyre example
- 14:53Pyre error suppression
- 17:27mypi
- 18:12monkeytype
- 20:00howmonkeytype works
- 21:14how to get started
related talks
03h 38mPython Types for Fun and Profit
28mMind the gap! Why static typing requires more than just adding annotations
57mWhy You Should Care About Types
31mTaming the Duck with Type Hints
35mStatic Typing in Python
32mStatic Typing in Python
31mStatic Type Analysis for Robust Data Products
29mStatic Typing in Python
