Bundles the 2026-07-12 code-audit session (Clusters A/B/C/D partial/E/F): denormalized Post/Advertisement reaction/comment/repost counters synced transactionally instead of live _count queries; real cursor-based pagination for followers/following/blocks lists; assertPetOwnership + formatRelativeTime centralized; dead r2.ts + AWS SDK deps removed; missing DB indexes added; account-deletion flow, mention notifications, pull-to-refresh feed, and mobile UI/i18n fixes from the surrounding sessions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
823 B
823 B
paths
| paths | ||
|---|---|---|
|
Python Patterns
This file extends common/patterns.md with Python specific content.
Protocol (Duck Typing)
from typing import Protocol
class Repository(Protocol):
def find_by_id(self, id: str) -> dict | None: ...
def save(self, entity: dict) -> dict: ...
Dataclasses as DTOs
from dataclasses import dataclass
@dataclass
class CreateUserRequest:
name: str
email: str
age: int | None = None
Context Managers & Generators
- Use context managers (
withstatement) for resource management - Use generators for lazy evaluation and memory-efficient iteration
Reference
See skill: python-patterns for comprehensive patterns including decorators, concurrency, and package organization.