Taming the Duck with Type Hints
summary
Type hints are a noninvasive way to get compiler-like checks: static tools like mypy read annotations, use the typeshed stubs, and flag wrong operations, changing-variable errors and illegal writes to Final. Editors surface those checks as you type. Structural typing via protocols lets duck typing coexist with checkers. The runtime ignores hints so behaviour doesn’t change, but gradual adoption reveals many real bugs early — the ecosystem evolves fast (about 30 PEPs in eight years).
AI-written summary · about
chapters (5)
- 0:00Start
- 0:19OVERVIEW
- 4:50TYPES OF TYPES - DYNAMIC, DUCK AND STATIC
- 25:00ARE TYPE HINTS WORTH IT?
- 29:56REFERENCES
related talks
28mProtocol: the keystone of type hints
29mPython Type hints and how they can supercharge CS education.
24mDuck Typing Is For The Birds
33mType Hints
28mMind the gap! Why static typing requires more than just adding annotations
46mType Hints for Python 3.5
47mPythonic type hints with typing.Protocol
15mTaming Type Annotations in Gradual Typing
