python-type-hints

Standardizes Python type hints using PEP 695, TypedDict, Protocol, and pyright strict mode.

1|1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Jylhis/skills --skill python-type-hints-jylhis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-type-hints
Source: https://github.com/Jylhis/skills/tree/main/skills/python-type-hints
Command: npx skills add https://github.com/Jylhis/skills --skill python-type-hints-jylhis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python typing has been optional and inconsistent; this guide provides a structured approach to modern typing in Python to improve readability, maintainability, and tooling support with PEP 695 generics, TypedDict, Protocol, Literal, Final, and overloads, while clarifying runtime validation boundaries.

Core Features & Use Cases

  • PEP 695 generics and new syntax for scalable type parameters.
  • TypedDict and Protocol usage to model precise data shapes and structural typing.
  • Literal, Final, and overloads to constrain values and support multiple function signatures.
  • pyright strict mode recommendations to enable strong static checks and safer runtimes.
  • Guidance for runtime validation boundaries using Pydantic or dataclass checks.

Quick Start

Annotate new code with the recommended Python type hints to enable static analysis and safer runtimes.

Frequently Asked Questions about python-type-hints

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use PEP 695 generics syntax in Python type hints?

TypedDict and Protocol enable precise data shape modeling and structural typing in Python type hints, replacing inconsistent optional typing with a structured approach for better static analysis and maintainability.

How do I configure pyright strict mode for Python static analysis?

Configuring pyright strict mode enables strong static checks for Python type hints, validating generics, Literal constraints, and Final declarations to ensure safer runtimes and improved correctness across your codebase.

What is the best way to define runtime validation boundaries with Python type hints?

Defining runtime validation boundaries involves using Pydantic or dataclass checks alongside Python type hints to separate static analysis from runtime validation, ensuring clear data enforcement without polluting pure type annotations.

Can I use Literal and Final to constrain values in Python typing?

Python type hints standardization applies to projects of any size, covering code creation, review, and migration scenarios by adopting generics, TypedDict, and Protocol to satisfy requirements for PEP 695 syntax and strict mode checks.