Python 3 Types in the Wild: A Tale of Two Type Systems
summary
Paper compares MyPy and PyType by running both on ~70,000 GitHub repos and finds 2,678 annotated repos, of which 318 pass MyPy. MyPy treats unannotated parameters as Any and forbids locals changing type; PyType infers changing local types and accepts some patterns MyPy flags. Excluding imports MyPy reports 23,665 errors and PyType 65,938; a hand audit of sampled errors shows 49% MyPy false positives and 44% for PyType, so tools disagree frequently.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:14Overview
- 0:49Python 3 & PEP484& Tools
- 1:42Type of an unannotated local variable
- 2:05Type of an unannotated function parameter
- 2:39Type of list and dictionary literals
- 3:23Return type of an unannotated function
- 3:56Research Questions
- 4:20RQI: How often and in What Ways Do Developers Use Python 3 Types?
- 6:37RQ2: Which Type Errors Do Developers Make?
- 8:23RQ3: How Do Type Errors From Different Tools Compare?
- 9:38Deep Semantic Errors
- 11:20Conclusion
related talks
57mWhy You Should Care About Types
28mGradual Typing in Python
03h 38mPython Types for Fun and Profit
24mDuck Typing Is For The Birds
30mStatic type checking with mypy
23mmypy Python's gradual typing implementation
04mUnpopular Opinion? - Python Typing Is Not Worth It
27m"How to Use Static Typing in Python with Type Hints, MyPy and Pydantic"
