Advanced Static Typing with mypy (part1)
dev.to·3d·
Discuss: DEV
🌊Gradual Typing
Preview
Report Post

Lessons learned from 7 years of annotating a large code base

"I don’t meditate, I annotate"

Introducing static typing and mypy to a large code base is not for the faint of heart, but the benefits are worth the effort:

  • release fewer bugs
  • make large refactors with confidence
  • navigate codebase with ease
  • rapidly onboard new developers

Once you’ve worked with a well-typed python project, working with "naked" code is painful. In fact, you may find, like I did, that annotating code is a rewarding puzzle that can be quite meditative.

This article is not an introduction to static typing, there are other great resources for that. This is adapted from an internal wiki that I wrote over several years of collecting solutions to common p…

Similar Posts

Loading similar posts...