mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-11-04 01:47:36 +03:00 
			
		
		
		
	Minor Factory and Singleton provider docs update
This commit is contained in:
		
							parent
							
								
									e3ea517d72
								
							
						
					
					
						commit
						ab548df0b2
					
				| 
						 | 
					@ -119,7 +119,9 @@ Next example shows how ``Factory`` provider deals with positional and keyword
 | 
				
			||||||
``__init__`` context arguments. In few words, ``Factory`` provider fully
 | 
					``__init__`` context arguments. In few words, ``Factory`` provider fully
 | 
				
			||||||
passes positional context arguments to class's ``__init__`` method, but
 | 
					passes positional context arguments to class's ``__init__`` method, but
 | 
				
			||||||
keyword context arguments have priority on ``KwArg`` injections (this could be
 | 
					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
 | 
					.. 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
 | 
					attribute injections. Those injections are done by setting specified attributes
 | 
				
			||||||
with injectable values right after object's creation.
 | 
					with injectable values right after object's creation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. image:: /images/factory_attribute_injections.png
 | 
					.. image:: /images/factory_attribute_injections.png
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. code-block:: python
 | 
					.. 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
 | 
					(usage of public attributes instead of setter methods), but it may appear in
 | 
				
			||||||
some cases.
 | 
					some cases.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. image:: /images/factory_method_injections.png
 | 
					.. image:: /images/factory_method_injections.png
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. code-block:: python
 | 
					.. code-block:: python
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
					``Singleton``'s memorized instance is done by clearing reference to it. Further
 | 
				
			||||||
lifecycle of memorized instance is out of ``Singleton`` provider's control.
 | 
					lifecycle of memorized instance is out of ``Singleton`` provider's control.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.. code-block:: python
 | 
					.. code-block:: python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    """`Singleton` providers resetting example."""
 | 
					    """`Singleton` providers resetting example."""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user