We discuss two different methodologies we have used to add type annotations to our Python services: gradually adding type annotations, or incrementally re-writing the code with type annotations. We'll discuss the benefits and challenges of each, when either may be appropriate, and our real-world experiences doing both.
Do you have a large Python code-base that you think would benefit from type annotations and a static type checker? Are you wondering how to go about adding those type annotations? Do you think you should just chuck it all and start over? We've been there, and we can help! After a period of rapid product development, we found ourselves with two decently sized code bases that were becoming increasingly difficult to maintain; having some experience with static type checking, we felt confident that it would help improve the developer experience, but we weren't sure how to go about it. In the end, we chose two different approaches for the two projects: the first, we started incrementally re-writing the application code with type annotations from the beginning, and the second, we started slowly adding type annotations to the existing code. Both techniques have their pros and cons, and, in the end, we felt like each was the right decision for that particular project. This talk will discuss the characteristics of each project which led us to chose one method over the other, and the techniques we used to accomplish the task. We'll also discuss how we broke down the work, maintained the type checker configurations and the overall success of the efforts, so far.
Speakers: Thomas Stephens