
Python Patterns
The python-patterns skill provides developers with idiomatic Python conventions, type hints, and best practices for writing robust, maintainable code aligned with PEP 8 standards. It guides Python developers writing, reviewing, or refactoring code by emphasizing readability, explicit logic, and Python-preferred patterns like EAFP exception handling. The skill addresses the need for consistent, high-quality Python development by documenting core principles and modern techniques including type annotations, type aliases, and protocol-based typing.
- skills.sh installs
- 7K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --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/everything-claude-code
- Category
- Python
More from affaan-m/everything-claude-code
All 256- Api Design6.9K
- Tdd Workflow6.9K
- Docker Patterns6.8K
- Java Coding Standards6.6K
- Python Testing6.6K
- Video Editing6.6K
- Django Security6.5K
- Springboot Security6.4K
- Article Writing6.3K
- Prompt Optimizer6.3K
- Cpp Coding Standards6.2K
- Market Research6.2K
- Strategic Compact6.1K
- Android Clean Architecture6K
- Springboot Tdd6K
- Continuous Learning5.9K
- Database Migrations5.9K
- Django Tdd5.9K
- E2e Testing5.9K
- Liquid Glass Design5.9K
- Security Scan5.9K
- Deployment Patterns5.8K
- Jpa Patterns5.8K
- Laravel Patterns5.8K