Python library maintainers should prioritize type-checking tests over source code
By
Marco Gorelli, Quansight Labs
Master baker tier. Every paragraph earns its place on the tray.
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 pulledThe 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.
You might also wanna read
GitHub - facebook/pyrefly: A fast type checker and language server for Python

10 Useful Code Formatters for Python Developers
A roundup article from LinuxLinks that selects and highlights 10 useful code formatters for Python developers, covering tools that help auto
igeek.gamer-geek-news.com·6d ago