
Python Patterns
This one's your copilot for writing Python that doesn't make other developers wince. It pushes you toward PEP 8, type hints, and idiomatic patterns like EAFP over LBYL. You get concrete examples of dataclasses, context managers, proper exception chaining, and when to use generators instead of building massive lists in memory. Activate it when writing new code, reviewing PRs, or refactoring legacy stuff. The guidance is opinionated in a good way, preferring explicit over clever and readability over showing off. It won't turn bad code into good code automatically, but it'll nudge you toward patterns that age well.
- skills.sh installs
- 6.7K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill python-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Python Development Patterns
Idiomatic Python patterns and best practices for building robust, efficient, and maintainable applications.
When to Activate
- Writing new Python code
- Reviewing Python code
- Refactoring existing Python code
- Designing Python packages/modules
Core Principles
1. Readability Counts
Python prioritizes readability. Code should be obvious and easy to understand.
# Good: Clear and readable
def get_active_users(users: list[User]) -> list[User]:
"""Return only active users from the provided list."""
return [user for user in users if user.is_active]
# Bad: Clever but confusing
def get_active_users(u):
return [x for x in u if x.a]
2. Explicit is Better Than Implicit
Avoid magic; be clear about what your code does.
# Good: Explicit configuration
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
# Bad: Hidden side effects
import some_module
some_module.setup() # What does this do?
3. EAFP - Easier to Ask Forgiveness Than Permission
Python prefers exception handling over checking conditions.
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Category
- Python
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Api Design6.6K
- Laravel Security6.6K
- Frontend Slides6.5K
- Codebase Onboarding6.4K
- Frontend Design Direction6.4K
- E2e Testing6.4K
- Liquid Glass Design6.4K
- Tdd Workflow6.4K
- Database Migrations6.4K
- Android Clean Architecture6.4K
- Prompt Optimizer6.3K
- Golang Patterns6.3K
- Postgres Patterns6.3K
- Verification Loop6.3K
- Article Writing6.3K
- Django Patterns6.2K
- Cpp Coding Standards6.2K
- Golang Testing6.2K
- Deep Research6.2K
- Java Coding Standards6.2K
- Blender Motion State Inspection6.1K
- Laravel Patterns6.1K
- Rust Patterns6.1K
- Springboot Patterns6.1K