~/talk

mypy Python's gradual typing implementation

Talkat PyCon Israel 2017 · 2017-06-11..06-13· [python]
links:none on file
slides:none on file

Mypy implements PEP 484/3107 implementation to add gradual typing to real codebases, catching wrong argument and assignment types before runtime while leaving Python behavior unchanged. It runs as an external CLI or in CI (used on a million+ lines at Dropbox), supports Python 3 annotations and Python 2 via comment syntax and --py2, provides typing, Any, Optional, type aliases, type inference, cast and reveal_type utilities, can ignore problematic C imports, and has basic PyCharm support and a web playground.

AI-written summary · about

  1. 0:00Intro
  2. 1:09Agenda
  3. 1:30Hey Python, how would you describe yourself?
  4. 2:05Dynamic typing vs Static typing
  5. 4:11Can you guess the arguments types?
  6. 4:58What can we do? #2 attempt
  7. 6:36Dude - what is Gradual Typing?
  8. 8:39Docstrings + pytest + type hints
  9. 9:03Installing mypy
  10. 9:18Using Type Hints in python 3
  11. 10:32Invoking mypy
  12. 11:01Things to note
  13. 12:01This is what Static types
  14. 12:23Multi-line function annotations
  15. 13:02Built-in types - typing module
  16. 13:27Type aliases
  17. 15:16# type: ignore
  18. 16:03Covfefe Typing
  19. 16:21Type Inference
  20. 17:51Explicit Types
  21. 18:28reveal type
  22. 19:25Optional - document None is valid
  23. 20:01isinstance
  24. 20:54References
  25. 21:31That's it for today
~/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.