From 885cb33528aaf430c94fd6e2657837919a6c95af Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 19 Jul 2023 17:41:51 +0200 Subject: [PATCH] Mention difference --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c4525bc..ddb35e4 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ registry.register_factory(Database, create_database) The generator-based setup and cleanup may remind you of [Pytest fixtures](https://docs.pytest.org/en/stable/explanation/fixtures.html). +Unlike typical dependency injection that passes your dependencies as arguments, the active obtainment of resources by calling `get()` when you *know* you're going to need it avoids the conundrum of either having to pass a factory (e.g., a connection pool -- which also puts the onus of cleanup on you), or eagerly creating resources that are never used. +