mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-06 13:23:15 +03:00
Update docs
This commit is contained in:
parent
f0df91ed02
commit
35e60e1d47
|
@ -35,24 +35,4 @@ You can do nested constructions:
|
||||||
:emphasize-lines: 26-32
|
:emphasize-lines: 26-32
|
||||||
:lines: 3-
|
:lines: 3-
|
||||||
|
|
||||||
The ``.provided`` attribute is available for the next providers:
|
|
||||||
|
|
||||||
- :py:class:`Factory` and its subclasses
|
|
||||||
- :py:class:`Singleton` and its subclasses
|
|
||||||
- :py:class:`Callable` and its subclasses
|
|
||||||
- :py:class:`Object`
|
|
||||||
- :py:class:`List`
|
|
||||||
- :py:class:`Selector`
|
|
||||||
- :py:class:`Dependency`
|
|
||||||
|
|
||||||
When you create a new provider subclass and want to implement the ``.provided`` attribute, you
|
|
||||||
should use the :py:class:`ProvidedInstance` provider. Add the ``.provided`` property
|
|
||||||
implementation to a new subclass:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
@property
|
|
||||||
def provided(self):
|
|
||||||
return ProvidedInstance(self)
|
|
||||||
|
|
||||||
.. disqus::
|
.. disqus::
|
||||||
|
|
Loading…
Reference in New Issue
Block a user