From ab548df0b288c1428d6dcef8d2171630ebb72489 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Thu, 18 Jun 2015 16:35:00 +0300 Subject: [PATCH] Minor Factory and Singleton provider docs update --- docs/providers/factory.rst | 8 +++++++- docs/providers/singleton.rst | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/providers/factory.rst b/docs/providers/factory.rst index d6ec5abe..77375eb1 100644 --- a/docs/providers/factory.rst +++ b/docs/providers/factory.rst @@ -119,7 +119,9 @@ Next example shows how ``Factory`` provider deals with positional and keyword ``__init__`` context arguments. In few words, ``Factory`` provider fully passes positional context arguments to class's ``__init__`` method, but keyword context arguments have priority on ``KwArg`` injections (this could be -useful for testing). So, please, follow the example below: +useful for testing). + +So, please, follow the example below: .. image:: /images/factory_init_injections_and_contexts.png @@ -213,6 +215,8 @@ Example below shows how to create ``Factory`` of particular class with attribute injections. Those injections are done by setting specified attributes with injectable values right after object's creation. +Example: + .. image:: /images/factory_attribute_injections.png .. code-block:: python @@ -283,6 +287,8 @@ Method injections are not very popular in Python due Python best practices (usage of public attributes instead of setter methods), but it may appear in some cases. +Example: + .. image:: /images/factory_method_injections.png .. code-block:: python diff --git a/docs/providers/singleton.rst b/docs/providers/singleton.rst index 1865cbb9..ab978b23 100644 --- a/docs/providers/singleton.rst +++ b/docs/providers/singleton.rst @@ -61,6 +61,8 @@ Created and memorized by ``Singleton`` instance can be reset. Reset of ``Singleton``'s memorized instance is done by clearing reference to it. Further lifecycle of memorized instance is out of ``Singleton`` provider's control. +Example: + .. code-block:: python """`Singleton` providers resetting example."""