Talks

Mind the gap! Why static typing requires more than just adding annotations

Friday, May 15th, 2026 11 a.m.–11:30 a.m. in Room 103ABC

Presented by

Jia Chen, Steven Troxler

Description

Have you ever tried to add types to an existing Python library or application and hit a wall or wondered why it can be so hard? This talk is for you!

Static typing is a powerful lever for working with code. It provides verifiable documentation, finds bugs quickly, enables less scary refactors, and unlocks tools like modern IDEs for understanding and navigating code.

But often we approach turning untyped code into statically typed code as if it’s just a matter of adding annotations. This is rarely the case, and understanding why can help.

Python was conceived as a dynamically typed language, so much of its rich library ecosystem emerged without types. Many powerful patterns that make Python useful are difficult to express statically, for example:

  • Pervasive duck typing
  • Metaprogramming and classes with dynamic behavior
  • Reliance on flow-sensitive type information that type checkers can’t track
  • Using heterogeneous containers in ways the type system can’t model

We’ll explore these patterns, why they’re hard to type and might not be worth typing, and offer advice for getting the most out of the type system in the presence of these patterns.

We’ll also look at how Python’s type system has evolved to support more dynamic use cases, and possible future directions.

What attendees will learn

  • Historical context on Python before static types
  • Common challenges adding types to code whose semantics don’t fit
  • Approaches for dealing with code that’s difficult to statically type
  • Perspective on how the Python type system evolves to handle a wider range of patterns

Search