What problem does it solve?
Provides concise, practical guidance to eliminate legacy typing, incorrect Pydantic v1 patterns, unsafe async usage, and other common anti-patterns that lower code quality and increase maintenance burden.
Core Features & Use Cases
- Modern typing and generics: Clear recommendations for PEP 695 style type aliases, built-in generics, and nullable union usage to improve type safety and readability.
- Pydantic v2 best practices: Guidance on using model_config, field validators, and discriminated unions to migrate from v1 patterns and avoid common pitfalls.
- Async, dataclasses, and testing: Patterns for async context managers, TaskGroup usage, immutable/dataclass value objects, and pytest techniques to build robust async code and reliable tests.
- Use Case: Ideal for engineers migrating a codebase to Python 3.12+, auditing repositories for typing and Pydantic anti-patterns, or establishing team-wide idioms.
Quick Start
Ask the assistant to review a Python file and provide fixes and explanations for modern 3.12+ typing, Pydantic v2 usage, async patterns, dataclass practices, and common anti-patterns.