91% of Popular Python Libraries Use Type Hints, but Median Parameter Coverage Is Only 45.8%
Analyzing 1,000 popular GitHub repositories, extracting their annotations and tracing them through git history, the authors find 91% of libraries use type hints at least once but adoption is inconsistent. Among libraries with systematic usage, maintainers concentrate on function parameters and return types at median coverage of 45.8% and 35.9% respectively and mostly use built-in types (73.0%), with annotations migrating toward more expressive types when modified. Developers annotate members even where Pyright can already infer the type, and those hand-written annotations usually simplify the inferred one, supporting the conclusion that type hints in libraries function as API contracts rather than complete implementation descriptions.
↳ Follow the thread