Skip to content
Back to skills

Python Typing Advanced

ASecurity

Use when implementing advanced Python typing patterns.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
ai-agentspython

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill python-typing-advanced --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Typing Advanced?

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

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

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
---
name: python-typing-advanced
description: "Use when implementing advanced Python typing patterns."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [python, typing, generics, Protocol, TypeVar, mypy]
    related_skills: [python-decorators-advanced, python-generators-coroutines, type-system-design-theory]
---

# Advanced Python Typing

Implementing advanced Python typing — from generics and protocols through variadic generics, type narrowing, and mypy strict mode.

## When to Use

- Type-safe Python codebases at scale
- Generic functions and classes
- Structural subtyping with Protocol
- Custom type guards and narrowing

## Typing Patterns

```python
from typing import TypeVar, Protocol, Generic, overload

T = TypeVar('T')
S = TypeVar('S')

class Comparable(Protocol):
    def __lt__(self, other) -> bool: ...

class Stack(Generic[T]):
    def __init__(self): self.items: list[T] = []
    def push(self, item: T) -> None: self.items.append(item)
    def pop(self) -> T: return self.items.pop()

@overload
def process(x: int) -> str: ...
@overload
def process(x: str) -> int: ...
def process(x):
    if isinstance(x, int): return str(x)
    return int(x)
```

## Verification Checklist

- [ ] TypeVar for generic functions and classes
- [ ] Protocol for structural subtyping
- [ ] @overload for type-specific signatures
- [ ] Literal, TypedDict, Final type constructs
- [ ] mypy --strict compliance

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.

Comments

Loading comments…

Newsletter

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