Python Patterns
Installation
SKILL.md
Python Patterns
Guidance for writing idiomatic, modern Python code.
Modern Python Features (3.9+)
| Feature | Purpose | Key Concept |
|---|---|---|
| Type hints | Static analysis | def func(x: str) -> int: |
| Dataclasses | Structured data | Auto __init__, __repr__, etc. |
| Context managers | Resource cleanup | with statement guarantees cleanup |
| Decorators | Cross-cutting concerns | Wrap functions to add behavior |
| Async/await | Concurrent I/O | Non-blocking operations |
Type Hints
Modern syntax (3.10+): Use | for unions, built-in types for generics.