Skip to content
Back to skills

Python Typing

ASecurity

Add precise Python type hints checked by mypy or pyright, with typed boundaries and minimal Any

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentspython

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill python-typing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Typing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Typing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-python-typing/badge)](https://www.skillsdirectory.com/skills/ansh44233-python-typing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Add precise Python type hints checked by mypy or pyright, with typed boundaries and minimal Any
profile: standard
languages: python
tags: python, typing, mypy, pyright
---

# Python typing

Types pay off most at boundaries: public functions, I/O, and data models.

## Practice
- Annotate public functions and class attributes; let locals be inferred.
- Model data with dataclasses, pydantic or `TypedDict`, not raw dicts.
- Use `Protocol` for duck typing, `Literal` and enums for fixed values, `TypeVar`/generics for containers.

## Strictness
- Enable strict mode incrementally per package; ban new `Any` and `# type: ignore` without a reason code.
- Install stub packages (`types-requests`) instead of ignoring imports.

## Verify
`mypy --strict` (or `pyright`) passes on the changed modules with no new ignores.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.