Refactor dependency provider docs

This commit is contained in:
Roman Mogylatov 2021-01-29 08:59:12 -05:00
parent 6a2d53a28e
commit 3e4667e2fe

View File

@ -3,11 +3,10 @@ Dependency provider
.. 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
called ``instance_of``. ``Dependency`` provider controls the type of the returned object to be an
instance of the ``instance_of`` type.
To specify a type of the dependency use ``instance_of`` argument: ``Dependency(instance_of=SomeClass)``.
Dependency provider will control that returned object is an instance of ``instance_of`` type.
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``