Keynote – Łukasz Langa
summary
Argues that type annotations reveal, not add, complexity and that readable annotations and small refactors make large codebases maintainable; demonstrates using modern typing features landed since Python 3.5 (recommend Python 3.9/3.10 typing), gives concrete recipes: name complex types, prefer concrete return types over unions, use exceptions instead of None, split dynamic functions, and format with Black; points to TypedDict and NewType and mentions self type and variance as next steps.
AI-written summary · about
chapters (15)
- 0:00Start
- 4:36TYPE ANNOTATIONS ARE DOCUMENTATION
- 6:29UGLY TYPE ANNOTATIONS HINT AT UGLY CODE
- 8:17USE MODERN TYPING SYNTAX
- 11:05STANDARDIZE SIGNATURE FORMATTING
- 12:28GIVE YOUR TYPES MEANINGFUL NAMES
- 14:22DISPATCH EARLY TO SPECIALIZE
- 20:02USE EXCEPTIONS FOR EXCEPTIONAL STATES
- 20:36USE EMPTY VALUES
- 28:50ONE VARIABLE ONE TYPE
- 30:51NOMINAL VS STRUCTURAL TYPING
- 33:21A STRING IS ALSO AN ITERABLE OF STRINGS
- 34:41object
- 40:39TOO MUCH OF A GOOD THING CAN HURT YOU
- 41:17IF YOUR TYPES ARE UGLY CONSIDER REFACTORING
related talks
32mType-checked Python in the real world
57mWhy You Should Care About Types
28mMind the gap! Why static typing requires more than just adding annotations
16mTyping in Python: Bringing Clarity, Safety, and Speed to Your Code
01h 10mKeynote 2: Robust Python and Why It Matters
03h 40mTyping
04mUnpopular Opinion? - Python Typing Is Not Worth It
38mMigrating existing codebases to using type annotations
