python-patterns
Installation
SKILL.md
Python Patterns
Write Python that is type-safe, testable, and a joy to maintain.
Core Principles
1. Explicit Over Implicit
Use type hints. Avoid *args and **kwargs when named parameters work. Favor clear interfaces over dynamic flexibility.
2. Composition Over Inheritance
Python's multiple inheritance is powerful but dangerous. Prefer composition and protocols over deep class hierarchies.
3. Async Done Right
Async is a tool for I/O-bound workloads, not a universal default. Use synchronous code for CPU-bound tasks, async for network calls and file I/O.
4. Test-First for Critical Paths
Your business logic should be testable without mocks. Use dependency injection. Keep I/O at the boundaries.