What problem does it solve?
Prevent runtime type errors and ambiguous APIs by making types explicit, enabling static analysis to find issues before they reach production.
Core Features & Use Cases
- Type annotations: Add and maintain annotations for functions, methods, and public interfaces to improve readability and tooling support.
- Generics & TypeVars: Create reusable, type-preserving containers and APIs that maintain correctness across type parameters.
- Protocols & Structural Typing: Define interface-like contracts without inheritance for flexible, testable designs.
- Type narrowing & guards: Guide checkers to refine union types and eliminate unsafe assumptions.
- Configuration: Provide mypy and pyright guidance for enabling strict mode in CI and incremental adoption in large codebases.
- Use Case: Annotate an existing service layer to enable mypy --strict in CI, introduce a generic Result type, and add protocols for external adapters.
Quick Start
Add type annotations to the selected module, implement generics and protocols where appropriate, and produce a mypy/pyright configuration that enables strict checking.