From 3e4667e2fed535b8d446a8f29d3b20739e4677ea Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Fri, 29 Jan 2021 08:59:12 -0500 Subject: [PATCH] Refactor dependency provider docs --- docs/providers/dependency.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/providers/dependency.rst b/docs/providers/dependency.rst index 1246ceae..6f1d061a 100644 --- a/docs/providers/dependency.rst +++ b/docs/providers/dependency.rst @@ -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``