mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-19 21:10:57 +03:00
Update docs
This commit is contained in:
parent
4a8133204c
commit
9b30752da2
|
@ -48,6 +48,21 @@ injectable values are also provided by another factories:
|
||||||
.. literalinclude:: ../../examples/providers/factory_init_injections.py
|
.. literalinclude:: ../../examples/providers/factory_init_injections.py
|
||||||
:language: python
|
:language: python
|
||||||
|
|
||||||
|
Factory providers and building complex object graphs
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
You can use :py:class:`Factory` provider to build complex object graphs.
|
||||||
|
|
||||||
|
Consider next example:
|
||||||
|
|
||||||
|
.. literalinclude:: ../../examples/providers/factory_deep_init_injections.py
|
||||||
|
:language: python
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
You can use ``__`` separator in the name of the keyword argument to pass the value to the child
|
||||||
|
factory, e.g. ``algorithm_factory(task__loss__regularizer__alpha=0.5)``.
|
||||||
|
|
||||||
.. _factory_providers_delegation:
|
.. _factory_providers_delegation:
|
||||||
|
|
||||||
Factory providers delegation
|
Factory providers delegation
|
||||||
|
|
Loading…
Reference in New Issue
Block a user