Typing at scale: statically type-checking a large codebase

Track:
Tooling, Packaging, Developer Productivity
Type:
Talk
Level:
intermediate
Duration:
30 minutes

Abstract

Once upon a type in Pythonland, we would say: If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck."

Then the type-checking team started scoring multiple goals. Is type-checking useful in Python? What about existing codebases? Recommendations and pitfalls.

In this talk, we'll take a look at:

  • why should you typecheck your code? what are the benefits and drawbacks?
  • how can you do that without stopping development, but without chasing an ever-changing target?
  • what are the pitfalls from type checking - can it provide a false sense of security?
  • How to interact with third party libraries?
  • Is static type-checking enough, or do we need to runtime check as well?
  • Is the type checker always right?

This is a case study about how it was done (and is still being done) on a real, large production codebase at Aiven. This is not a theoretical talk - I'll try explaining what are the major pitfalls, what problems were solved and what problems were introduced by type checking.

And I'll finally answer The Big Question: would you do that again?