Metraipolis › archive › dc_4d95ea09a054

Type Hints in Python Libraries and Frameworks: An Empirical Analysis of Adoption and Maintenance — arXiv:2609.02782

Source
arXiv (en)
Original
https://arxiv.org/abs/2609.02782
License (as archived)
CC0-1.0
Archived
2026-10-17T05:14:02.857Z
SHA-256 of the archived text
56f2c80455df5b1d50e65a88ee0e0a0b528a9ee06c108a4a0df677c876828979
Stable URL of this page
https://metraipolis.com/documento/dc_4d95ea09a054

How to cite

Type Hints in Python Libraries and Frameworks: An Empirical Analysis of Adoption and Maintenance — arXiv:2609.02782 — arXiv (en), https://arxiv.org/abs/2609.02782 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_4d95ea09a054 (Metraipolis archive dc_4d95ea09a054, sha256 56f2c80455df5b1d50e65a88ee0e0a0b528a9ee06c108a4a0df677c876828979)
BibTeX
@misc{dc4d95ea09a054,
  title = {Type Hints in Python Libraries and Frameworks: An Empirical Analysis of Adoption and Maintenance — arXiv:2609.02782},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2609.02782},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_4d95ea09a054; sha256 56f2c80455df5b1d50e65a88ee0e0a0b528a9ee06c108a4a0df677c876828979},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.02782. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Context: In Python, type hints allow developers to annotate variables and functions with explicit type information, improving code clarity and reliability. Although type hints are widely available, little is known about how they are adopted and maintained in libraries and frameworks. Objective: We investigate the adoption, usage, maintenance, and rationale of type hints in Python libraries and frameworks. Method: We analyzed 1,000 popular GitHub repositories, identifying libraries and frameworks and extracting their type annotations. We examined annotation coverage, the locations and origins of annotations, their evolution across git histories, and the relationship between developer annotations and types inferred by Pyright. Results: Of the analyzed repositories, 91% of libraries use type hints at least once, although adoption is inconsistent. Among libraries with systematic usage, maintainers prioritize function parameters and return types, with median coverage of 45.8% and 35.9%, respectively, and mainly use built-in types (73.0%). When modified, annotations tend to migrate to more expressive types. Developers annotate members even when Pyright can infer their types, and these annotations often simplify the inferred type. Conclusion: Type hints in Python libraries and frameworks primarily serve as API contracts rather than comprehensive descriptions of implementation details. The findings suggest opportunities for tooling that prioritizes public interfaces, identifies meaningful annotation changes, and supports maintainers in evolving type information.

Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-03 in cs.SE).
Categorie arXiv: Software Engineering (cs.SE).
Pagina del lavoro: https://arxiv.org/abs/2609.02782 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-17T04:25:46.777Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-09-03?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).