Skip to content

feat: five modern-Python patterns — catalog complete at 32 units - #8

Merged
SuperElectron merged 1 commit into
stagingfrom
feat/modern-patterns
Aug 27, 2026
Merged

feat: five modern-Python patterns — catalog complete at 32 units#8
SuperElectron merged 1 commit into
stagingfrom
feat/modern-patterns

Conversation

@SuperElectron

Copy link
Copy Markdown
Owner

Phase 9 — the planned catalog is complete: 32 units (1 principle + 3 Python-native + 23 GoF + 5 modern).

Unit Verdict Stdlib sighting
modern/dependency_injection pythonic sorted(key=), json.dumps(cls=)
modern/repository use-with-care sqlite3 impl beside the in-memory fake
modern/context_manager pythonic contextlib.ExitStack
modern/registry pythonic codecs registry
modern/async_producer_consumer use-with-care asyncio.Queue + TaskGroup

Deps: pytest-asyncio (dev, auto mode).

Gates: ruff ✅ mypy --strict ✅ pytest 211 ✅ all 96 demos run (python -m patterns.<group>.<slug>.<variant>) ✅

🤖 Generated with Claude Code

New group patterns/modern/:

- dependency_injection (pythonic) — Protocol seams, kwarg defaults;
  sorted(key=), json.dumps(cls=)
- repository (use-with-care) — Protocol + in-memory fake + sqlite impl
- context_manager (pythonic) — __enter__/__exit__, @contextmanager,
  ExitStack
- registry (pythonic) — decorator-filled dispatch dict; codecs
- async_producer_consumer (use-with-care) — asyncio.Queue + TaskGroup
  with backpressure and tested shutdown; thread version for contrast

Adds pytest-asyncio (auto mode). 211 tests; ruff/mypy --strict clean;
all 96 demos run as modules.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@SuperElectron
SuperElectron merged commit ce0d8e0 into staging Aug 27, 2026
3 checks passed
@SuperElectron
SuperElectron deleted the feat/modern-patterns branch August 27, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant