Summary
ty is Astral's Rust-based Python type checker (beta). It's 10-100x faster than mypy, checks unannotated function bodies by default, and supports advanced features like intersection types and reachability analysis.
libtmux is well-positioned for ty adoption:
- No mypy plugins in use (ty's biggest gap — no plugin system)
- Only 9
type: ignore comments across the codebase
- Already uses Astral's ruff and uv tooling
- Strict mypy configuration with full type annotations
Goals
- Add ty as a dev dependency alongside mypy (not replacing it)
- Add ty configuration in
pyproject.toml and justfile targets
- Add ty to CI as a non-blocking step
- Compare diagnostics: what ty catches vs mypy, false positives, speed
- Determine if ty can eventually displace mypy
Approach
- Gradual adoption: run both checkers in parallel
- Start with known-noisy rules suppressed, re-enable incrementally
- CI runs ty with
continue-on-error: true so it doesn't block builds
- Document findings in the PR for future reference
References
Summary
ty is Astral's Rust-based Python type checker (beta). It's 10-100x faster than mypy, checks unannotated function bodies by default, and supports advanced features like intersection types and reachability analysis.
libtmux is well-positioned for ty adoption:
type: ignorecomments across the codebaseGoals
pyproject.tomland justfile targetsApproach
continue-on-error: trueso it doesn't block buildsReferences