Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python Type Hints

José Padilla
March 15, 2018
430

Python Type Hints

5min talk on Python Type Hints. Presented at newhaven.io

José Padilla

March 15, 2018
Tweet

Transcript

  1. $ python app.py f 1 Traceback (most recent call last):

    File "app.py", line 12, in <module> print(first(1)) # TypeError File "app.py", line 7, in first return seq[0] TypeError: 'int' object is not subscriptable
  2. $ mypy app.py main.py:12: error: Argument 1 to "first" has

    incompatible type "int"; expected "Sequence[<nothing>]"