~/talk

Exploring Function Annotations

Talkat PyOhio 2016 · 2016-07-30..07-31· [python, typescript]
github:agfor
slides:none on file

Shows how Python function annotations become machine-readable metadata and how the standard library typing plus the static checker mypy catch wrong-call types, demonstrate Optional/Union to accept None or multiple types, and use an annotation-driven convert function that coerces inputs and outputs (strings→ints→bools) so a single implementation accepts varied encodings. Examples include annotating returns that can be None, mypy errors for incompatible calls, and a practical converter used for mathematical helpers that normalizes incoming data before running core logic.

AI-written summary · about

  1. 0:00Introduction to docstrings
  2. 3:00Function annotations basics
  3. 5:04Accessing annotation data
  4. 6:59Static type checking with Mypy
  5. 8:53Handling optional return types
  6. 10:34Advanced typing with Union
  7. 12:26Using annotations for runtime
  8. 16:24Conclusion and Q&A
~/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.