Talks

Type Hints in Real-World Projects: Practical Steps for Continuous Maintenance and Improvement

Saturday, May 17th, 2025 1:45 p.m.–2:15 p.m. in Hall C

Presented by

Koudai Aono

Experience Level:

Some experience

Description

Many Python developers have added type hints and run mypy checks, but still rely on typing.Any too often, keep old typing.List/typing.Dict hints, or use # type: ignore comments everywhere. In that case, typing may feel like just another task, not a tool that truly improves quality.

But like unittest, typing can reduce hidden issues and make you confident about changes, even though it does not add new features directly. If we maintain and improve our type hints over time, typing can become a reliable foundation for your project, making refactoring safer and Python upgrades smoother.

This talk is not just another basic intro. We’ll show practical steps with before-and-after code examples: - Use ideas from newer features (like typing.TypeIs in Python 3.13) and typing_extensions to apply similar concepts on older versions.
- Run pyupgrade (via ruff) to automatically update old hints, reducing manual edits and creating a consistent style.
- Apply partial ignores instead of full # type: ignore, and integrate pre-commit and CI checks to catch issues early, making typing checks feel natural.
- Add types to example code to detect subtle incompatibilities, similar to how tests find hidden bugs.

We’ll also propose a gradual approach so your team won’t be overwhelmed. After this talk, you should see typing as a stable base that reduces bugs, helps with refactoring, and supports long-term growth.

Who should attend this talk?
This talk is for intermediate Python developers who already use basic type hints but feel they are not getting enough value out of them yet. If you want to go beyond minimal checks and keep your typing strong as your project grows, this session will show you practical steps you can take.

Search