Michael Sullivan

Michael is a recovering academic with an unfortunate fondness for indefensible hacks. He works at Dropbox on the mypy and mypyc projects.

mypy - Getting to Four Million Lines of Typed Python

Scale & Performance, DevOps, Testing, & Automation, Advanced
8/18/2019 | 11:20 AM-12:05 PM | Robertson

Description

Dropbox is a heavy user of the mypy type checker, recently passing four million lines of type-annotated Python code, with over half of that added in the last eighteen months. Type checking is helping find bugs, making code easier to under stand, enabling refactors, and is an important aid to our ongoing Python 3 migration.

In this talk, we discuss how we got there. We’ll talk about what we tried in order to get our engineers to type annotate their code—what worked, what didn’t, and what our engineers had to say about it.

Additionally, we’ll discuss the performance problems we faced as the size of our checked codebase grew, and the techniques we employed to allow mypy—which is implemented in Python—to efficiently check (faster than a second, for most incremental checks) millions of lines of code, which culminated in mypyc, a new ahead-of-time compiler for type-annotated Python!

Abstract