We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Migrating existing codesbases to using type annotations

Formal Metadata

Title
Migrating existing codesbases to using type annotations
Alternative Title
Type annotations with larger codebases
Title of Series
Number of Parts
132
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
You've heard about type annotations, you know they help reduce bugs and improve documentation especially for large codebases, and you've attended an introductory talk or read a tutorial about using them. But how do you get started using them with your big, existing codebase? How do you make sure your colleagues will be annotating new code they write - or existing code they're changing? And how do you get around some of the issues you might run into when using the still-beta type checker mypy on your codebase? This talk will start where the typical introductory Python type annotation talks end and discuss the real-world challenges when starting to annotate types with an existing codebase of tens or hundreds of thousands of lines of code. I'll walk you through best practices learned from doing just that at Yelp, telling you about some of the roadblocks we hit (and how we got past them). We'll also take a look at: - how you can get the most out of type annotations even with non-annotated third-party libraries - how to deal with code patterns that currently don't always work well with annotations - when the only way to get proper type checking is through refactoring your code.