~/talk

Migrating existing codebases to using type annotations

Talkat PyCon.DE 2017 · 2017-10-25..10-27· [python, typescript]
links:none on file
slides:none on file

Shows how a large legacy Python codebase (tens or hundreds of thousands of lines) is incrementally annotated, enforced per‑file via pre-commit hooks, and type‑checked with mypy. Demonstrates generated typed models and client stubs from OpenAPI to catch mismatched network types, practical workarounds for namedtuple and descriptor quirks, typed dicts to eliminate silent key bugs, and limits like recursive types. Builds run‑time‑free checks that mostly work and surface surprising refactor needs.

AI-written summary · about

  1. 0:00Introduction
  2. 0:30Yelp
  3. 0:50Talk Outline
  4. 2:30Code Example
  5. 4:00Migrating a bigger codebase
  6. 5:15Python type checker
  7. 6:20Enforce type annotations
  8. 8:00Precommit
  9. 8:30Precommit configuration
  10. 9:50Running precommit hooks
  11. 11:55Type your datum
  12. 13:25Dictionaries
  13. 15:25Type Data
  14. 15:50Instantiate
  15. 16:15NamedTuple
  16. 17:00Errors
  17. 17:50Class attributes
  18. 18:20Name tuples
  19. 19:05Solution
  20. 20:15Structural subtyping
  21. 20:45Named tuples
  22. 21:20Metaclasses
  23. 22:20Descriptor
  24. 24:10recursive types
  25. 24:25cast operator
  26. 25:00serviceoriented architecture
  27. 26:05confidence in changes
  28. 27:05API specification
  29. 27:35API model
  30. 28:55Generating typed annotations
  31. 29:30Generated code
  32. 31:45Example function
  33. 36:15Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.