Rules Include
Style
- PEP 8 compliance with 88-char line length (Black formatter)
- Type hints on all function signatures
- Google-style docstrings
- f-strings over
.format()or%
Patterns
- Dataclasses and Pydantic models over plain dicts
- Context managers for resource handling
- Generators for large data processing
pathlib.Pathoveros.path
Testing
- pytest with fixtures and parametrize
- Arrange-Act-Assert pattern
- Mock external dependencies, not internal logic
Modern Python (3.12+)
- Match statements for complex conditionals
typekeyword for type aliases- Exception groups with
except*