Gradual Typing in Python
summary
History of function annotations and PEP 484 leads to the typing module and three main checkers: mypy, PyCharm and Google’s PyType; stub files live in typeshed as .pyi. Real project experience: a 20,000-line Python 2 codebase reaches 60% annotation coverage using type comments, finds refactor bugs (changed call signatures) and improves IDE completions, but SQLAlchemy and metaclass-heavy modules remain untypable and require hacks like typing.TYPE_CHECKING and forward-reference strings.
AI-written summary · about








