~/talk

Type hints, protocols, and good sense

Talkat PyCon Latam 2021 · 2021-08-27..08-28· [python]
slides:none on file

Argues that Python supports four typing modes (static/dynamic, nominal/structural), claims protocols (PEP 544) are the central feature that enable static duck typing, and shows a concrete fix for the typeshed median bug by adding a sortable Protocol plus a TypeVar so median returns the right element. Points out type hints run only at tooling time (mypy), can explode into complex annotations (the overloads for max example), and recommends using protocols and tests rather than requiring hints everywhere.

AI-written summary · about

  1. 0:00Introduction
  2. 2:41Talk overview
  3. 7:58Four modes of typing
  4. 16:30Gradual typing in Python
  5. 21:50Typing protocols explained
  6. 32:52Limits of type hints
  7. 38:54Balanced use of type hints
  8. 41:40Summary and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.