From c3789c476608da69fff0a415ad241e2cad85a93a Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 16 Jun 2022 09:02:10 -0400 Subject: [PATCH] Common: Document dependency resolution precedence --- monkey/common/di_container.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monkey/common/di_container.py b/monkey/common/di_container.py index 0a735136e..683e72317 100644 --- a/monkey/common/di_container.py +++ b/monkey/common/di_container.py @@ -95,6 +95,11 @@ class DIContainer: injection. Note that only positional arguments are resolved. Varargs, keyword-only args, and default values are ignored. + Dependencies are resolved with the following precedence + + 1. Conventions + 2. Types, Instances + :param **type_**: A `type` (class) to construct :return: An instance of **type_** """ @@ -112,6 +117,8 @@ class DIContainer: that correspond `type_`'s dependencies. Note that only positional arguments are resolved. Varargs, keyword-only args, and default values are ignored. + See resolve() for information about dependency resolution precedence. + :param **type_**: A type (class) to resolve dependencies for :return: An Sequence of dependencies to be injected into `type_`'s constructor """