2.2 KiB
2.2 KiB
Python Typing Source Map
Use this page as the canonical source index when making typing modernization recommendations.
Core Language and Library Docs
- Typing module documentation
- Typing specification (typing.python.org)
- Built-in types and generic aliases
- Python language reference:
matchstatement - PEP 634: Structural Pattern Matching specification
- typing.cast reference (runtime no-op)
- Typing spec directives for
cast() - Mypy type narrowing and casts guidance
- Typing guide: exhaustiveness and
assert_never - Mypy:
Literal/Enumexhaustiveness withmatch
Tooling References
Modernization PEPs
- PEP 585: Type Hinting Generics In Standard Collections
- PEP 604: Allow writing union types as
X | Y - PEP 673: Self Type
- PEP 695: Type Parameter Syntax
Advanced Typing PEPs (Load on Demand)
- PEP 612: Parameter Specification Variables
- PEP 646: Variadic Generics
- PEP 647: User-Defined Type Guards
- PEP 655: Required and NotRequired for TypedDict
- PEP 742: Narrowing types with TypeIs
Version Gate Reminder
Before recommending syntax upgrades, verify the project's supported Python range and lint target so recommendations match runtime constraints.