← ClaudeAtlas

swe-programming-pythonlisted

Python coding standards from authoritative docs/explanation/software-engineering/programming-languages/python/ documentation
wahidyankf/ose-primer · ★ 2 · Data & Documents · score 75
Install: claude install-skill wahidyankf/ose-primer
# Python Coding Standards ## Purpose Progressive disclosure of Python coding standards for agents writing Python code. **Authoritative Source**: [docs/explanation/software-engineering/programming-languages/python/README.md](../../../docs/explanation/software-engineering/programming-languages/python/README.md) **Usage**: Auto-loaded for agents when writing Python code. Provides quick reference to idioms, best practices, and antipatterns. ## Quick Standards Reference ### Naming Conventions **Modules and Packages**: lowercase_with_underscores - `user_account.py`, `payment_processor.py` **Classes**: PascalCase - `UserAccount`, `PaymentProcessor` **Functions and Variables**: lowercase_with_underscores - Functions: `calculate_total()`, `find_user_by_id()` - Variables: `user_name`, `total_amount` **Constants**: UPPER_CASE_WITH_UNDERSCORES - `MAX_RETRIES`, `DEFAULT_TIMEOUT`, `API_ENDPOINT` **Private**: Single leading underscore - `_internal_function()`, `_private_var` ### Modern Python Features (3.11+) **Type Hints**: Use for all function signatures ```python def calculate_total(items: list[Item]) -> Decimal: return sum(item.price for item in items) ``` **Dataclasses**: Use for data containers ```python from dataclasses import dataclass @dataclass(frozen=True) class UserAccount: id: str name: str created_at: datetime ``` **Pattern Matching**: Use for complex conditionals ```python match payment: case CreditCard(number=n): process_cr