mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-03-27 13:24:23 +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
|
||||
|
||||
: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``
|
||||
|
|
Loading…
Reference in New Issue
Block a user