Type Hints in Python Libraries and Frameworks: An Empirical Analysis of Adoption and Maintenance
[Inżynieria oprogramowania] Autorzy: Thiago Roberto Magalhães, Fabio Petrillo, João Eduardo Montandon
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, main…
- Kategoria arxiv
- cs.SE
- Kategoria
- Inżynieria oprogramowania