Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound applications requiring non-blocking operations.
Apply KISS, SRP, composition and testable boundaries to a Python-owning task. Use for Python module design, tangled policy/I/O, coupling or abstraction decisions; not TypeScript, React or Next.js implementation merely because general design principles are relevant.
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.
Python project organization, module architecture, and public API design. Use when setting up projects, reorganizing module responsibilities, defining package boundaries, or planning directory layouts.
Python resource management with context managers, cleanup patterns, and streaming. Use when managing connections, file handles, implementing cleanup logic, or building streaming responses with accumulated state.
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
Python type safety with type hints, generics, protocols, and strict type checking. Use when adding type annotations, implementing generic classes, defining structural interfaces, or configuring mypy/pyright.