diff --git a/dependency_injector/providers/creational.py b/dependency_injector/providers/creational.py index 9b8d4dc3..f5232497 100644 --- a/dependency_injector/providers/creational.py +++ b/dependency_injector/providers/creational.py @@ -54,9 +54,8 @@ class Factory(Callable): .. py:attribute:: provided_type - If provided type is defined, :py:class:`Factory` checks that - :py:attr:`Factory.provides` is subclass of - :py:attr:`Factory.provided_type`. + If provided type is defined, provider checks that providing class is + its subclass. :type: type | None @@ -121,16 +120,12 @@ class Factory(Callable): class DelegatedFactory(Factory): - """:py:class:`DelegatedFactory` is a delegated :py:class:`Factory`. - - :py:class:`DelegatedFactory` is a :py:class:`Factory`, that is injected - "as is". + """:py:class:`Factory` that is injected "as is". .. py:attribute:: provided_type - If provided type is defined, :py:class:`Factory` checks that - :py:attr:`Factory.provides` is subclass of - :py:attr:`Factory.provided_type`. + If provided type is defined, provider checks that providing class is + its subclass. :type: type | None @@ -153,9 +148,10 @@ class DelegatedFactory(Factory): class Singleton(Factory): """:py:class:`Singleton` provider returns same instance on every call. - :py:class:`Singleton` provider creates instance once and return it on every - call. :py:class:`Singleton` extends :py:class:`Factory`, so, please follow - :py:class:`Factory` documentation to go inside with injections syntax. + :py:class:`Singleton` provider creates instance once and returns it on + every call. :py:class:`Singleton` extends :py:class:`Factory`, so, please + follow :py:class:`Factory` documentation for getting familiar with + injections syntax. :py:class:`Singleton` is thread-safe and could be used in multithreading environment without any negative impact. @@ -170,9 +166,8 @@ class Singleton(Factory): .. py:attribute:: provided_type - If provided type is defined, :py:class:`Factory` checks that - :py:attr:`Factory.provides` is subclass of - :py:attr:`Factory.provided_type`. + If provided type is defined, provider checks that providing class is + its subclass. :type: type | None @@ -222,16 +217,12 @@ class Singleton(Factory): class DelegatedSingleton(Singleton): - """:py:class:`DelegatedSingleton` is a delegated :py:class:`Singleton`. - - :py:class:`DelegatedSingleton` is a :py:class:`Singleton`, that is injected - "as is". + """:py:class:`Singleton` that is injected "as is". .. py:attribute:: provided_type - If provided type is defined, :py:class:`Factory` checks that - :py:attr:`Factory.provides` is subclass of - :py:attr:`Factory.provided_type`. + If provided type is defined, provider checks that providing class is + its subclass. :type: type | None diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index b16ad369..773110d5 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -11,6 +11,7 @@ Development version ------------------- - Add ``ThreadLocalSingleton`` and ``DelegatedThreadLocalSingleton`` providers. - Add documentation section about singleton providers and multi-threading. +- Update API docs of creational providers. 2.0.0 ------