python
Write idiomatic Python.
Style
- PEP 8 (black or ruff)
- Type hints for all signatures
- Docstrings (Google or NumPy style)
- pathlib over os.path
- f-strings for formatting
Common patterns
- Context managers (with)
- Dataclasses for data
- Enums for constants
- Protocol for duck typing
- match/case (3.10+)