Guide Python type annotations using the typing module: Protocol, TypeVar, ParamSpec, Generic, Literal, TypeAlias, overload, and dataclass field typing. Use when the user writes Python type hints, asks about typing, creates generic classes, defines protocols, or works with mypy/pyright. Trigger when you see untyped Python code that should be typed.
Receba novas skills de DevOps e Infra toda segunda
1 email curto, só com as skills novas de DevOps e Infra. 4 minutos de leitura, sem spam, cancela com 1 clique.
Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.
Ler descrição completaRecolher descrição
Python Type Hints Guide
Write precise, expressive type annotations that catch bugs at static analysis time. Modern Python typing (3.10+) is powerful enough to express complex relationships without runtime overhead.
When to Use
User writes or refactors Python functions without type hints
User asks about typing, generics, or protocols
User encounters mypy or pyright errors
User builds libraries or APIs that need clear contracts
User works with complex data structures or callbacks
[Description truncada. Veja o README completo no GitHub.]