Contribute Media
A thank you to everyone who makes this possible: Read More

Dec 2016 BayPiggies Talk at LinkedIn: Introducing Type Annotations for Python

Description

Speakers: Guido Van Rossum, Greg Price, and David Fisher

Dropbox has several million lines of production code written in Python 2.7. As a first step towards migrating to Python 3, as well as to generally make our code more navigable, we are annotating our code with type annotations using the PEP 484 standard and type-checking the annotated code with mypy. In this talk we will discuss lessons learned and show how you too can start type-checking your legacy Python 2.7 code, one file at a time. We will also describe some of the many improvements we’ve made to mypy in the process, as well as some other tools that come in handy.

Mypy is an open-source type-checker for Python. It was originally created by one of the speakers, Jukka Lehtosalo, in support of his PhD thesis, before he joined Dropbox. Mypy supports the PEP 484 standard for gradual typing in Python. It supports Python 3.2 and higher, as well as Python 2.7 (using function signatures in type comments, per a recent update to PEP 484).

Details

Improve this page