mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-07-16 11:02:24 +03:00
Refactor dependency provider docs
This commit is contained in:
parent
6a2d53a28e
commit
3e4667e2fe
|
@ -3,11 +3,10 @@ Dependency provider
|
||||||
|
|
||||||
.. currentmodule:: dependency_injector.providers
|
.. currentmodule:: dependency_injector.providers
|
||||||
|
|
||||||
:py:class:`Dependency` provider is a placeholder for the dependency of the specified type.
|
:py:class:`Dependency` provider is a placeholder for a dependency of a certain type.
|
||||||
|
|
||||||
The first argument of the ``Dependency`` provider specifies a type of the dependency. It is
|
To specify a type of the dependency use ``instance_of`` argument: ``Dependency(instance_of=SomeClass)``.
|
||||||
called ``instance_of``. ``Dependency`` provider controls the type of the returned object to be an
|
Dependency provider will control that returned object is an instance of ``instance_of`` type.
|
||||||
instance of the ``instance_of`` type.
|
|
||||||
|
|
||||||
The ``Dependency`` provider must be overridden before usage. It can be overridden by any type of
|
The ``Dependency`` provider must be overridden before usage. It can be overridden by any type of
|
||||||
the provider. The only rule is that overriding provider must return an instance of ``instance_of``
|
the provider. The only rule is that overriding provider must return an instance of ``instance_of``
|
||||||
|
|
Loading…
Reference in New Issue
Block a user