From 05b65f432cb14fc405d43def319db4cd6c8eb2b9 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Fri, 15 May 2015 17:44:20 +0300 Subject: [PATCH] Updating instance providers example --- docs/providers.rst | 7 ++++--- examples/readme2/instance_providers.py | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/providers.rst b/docs/providers.rst index 6e755c5d..89775790 100644 --- a/docs/providers.rst +++ b/docs/providers.rst @@ -34,10 +34,10 @@ Example: # Factory provider creates new instance of specified class on every call. - new_object = Factory(object) + object_factory = Factory(object) - object_1 = new_object() - object_2 = new_object() + object_1 = object_factory() + object_2 = object_factory() assert object_1 is not object_2 assert isinstance(object_1, object) and isinstance(object_2, object) @@ -53,6 +53,7 @@ Example: assert isinstance(object_1, object) and isinstance(object_2, object) + Injections ~~~~~~~~~~ diff --git a/examples/readme2/instance_providers.py b/examples/readme2/instance_providers.py index 7e3e7734..1be9acb2 100644 --- a/examples/readme2/instance_providers.py +++ b/examples/readme2/instance_providers.py @@ -5,10 +5,10 @@ from objects.providers import Singleton # Factory provider creates new instance of specified class on every call. -new_object = Factory(object) +object_factory = Factory(object) -object_1 = new_object() -object_2 = new_object() +object_1 = object_factory() +object_2 = object_factory() assert object_1 is not object_2 assert isinstance(object_1, object) and isinstance(object_2, object)