All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Python library maintainers should prioritize type-checking tests over source code

By

Marco Gorelli, Quansight Labs

5d ago· 6 min readenOpinion

Summary

This article addresses the growing challenge for Python library maintainers who feel overwhelmed by the increasing number of type checkers (Mypy, Pyrefly, Pyright, ty, Zuban, and others). The author argues that the common practice of running type checkers on source code while leaving tests untyped is backwards. Instead, maintainers should prioritize running as many type checkers as possible on their test suite, and at least one on their source code. The key insight is that type-checking tests provides more value for catching integration issues and ensuring library correctness.

Key quotes

· 3 pulled
The type checking that matters most (and why you've probably got it backwards)
It's common to see packages run type checkers on their source code and to leave their tests untyped. That approach has it backwards.
Prioritise running as many type-checkers as possible on your test suite. Run at least one on your source code.
Snippet from the RSS feed
Library maintainers may feel overwhelmed by the plurality of type checkers that exist. We offer some guidance on how to focus their efforts where they matter most.

You might also wanna read