Type hints cheat sheet (Python 2)
This document is a quick cheat sheet showing how the PEP 484 typelanguage represents various common types in Python 2.
Note
Technically many of the type annotations shown below are redundant,because mypy can derive them from the type of the expression. Somany of the examples have a dual purpose: show how to write theannotation, and show the inferred types.