mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-31 03:36:41 +03:00
Update API docs of creational providers
This commit is contained in:
parent
50e4de89b4
commit
16e9c3399c
|
@ -54,9 +54,8 @@ class Factory(Callable):
|
||||||
|
|
||||||
.. py:attribute:: provided_type
|
.. py:attribute:: provided_type
|
||||||
|
|
||||||
If provided type is defined, :py:class:`Factory` checks that
|
If provided type is defined, provider checks that providing class is
|
||||||
:py:attr:`Factory.provides` is subclass of
|
its subclass.
|
||||||
:py:attr:`Factory.provided_type`.
|
|
||||||
|
|
||||||
:type: type | None
|
:type: type | None
|
||||||
|
|
||||||
|
@ -121,16 +120,12 @@ class Factory(Callable):
|
||||||
|
|
||||||
|
|
||||||
class DelegatedFactory(Factory):
|
class DelegatedFactory(Factory):
|
||||||
""":py:class:`DelegatedFactory` is a delegated :py:class:`Factory`.
|
""":py:class:`Factory` that is injected "as is".
|
||||||
|
|
||||||
:py:class:`DelegatedFactory` is a :py:class:`Factory`, that is injected
|
|
||||||
"as is".
|
|
||||||
|
|
||||||
.. py:attribute:: provided_type
|
.. py:attribute:: provided_type
|
||||||
|
|
||||||
If provided type is defined, :py:class:`Factory` checks that
|
If provided type is defined, provider checks that providing class is
|
||||||
:py:attr:`Factory.provides` is subclass of
|
its subclass.
|
||||||
:py:attr:`Factory.provided_type`.
|
|
||||||
|
|
||||||
:type: type | None
|
:type: type | None
|
||||||
|
|
||||||
|
@ -153,9 +148,10 @@ class DelegatedFactory(Factory):
|
||||||
class Singleton(Factory):
|
class Singleton(Factory):
|
||||||
""":py:class:`Singleton` provider returns same instance on every call.
|
""":py:class:`Singleton` provider returns same instance on every call.
|
||||||
|
|
||||||
:py:class:`Singleton` provider creates instance once and return it on every
|
:py:class:`Singleton` provider creates instance once and returns it on
|
||||||
call. :py:class:`Singleton` extends :py:class:`Factory`, so, please follow
|
every call. :py:class:`Singleton` extends :py:class:`Factory`, so, please
|
||||||
:py:class:`Factory` documentation to go inside with injections syntax.
|
follow :py:class:`Factory` documentation for getting familiar with
|
||||||
|
injections syntax.
|
||||||
|
|
||||||
:py:class:`Singleton` is thread-safe and could be used in multithreading
|
:py:class:`Singleton` is thread-safe and could be used in multithreading
|
||||||
environment without any negative impact.
|
environment without any negative impact.
|
||||||
|
@ -170,9 +166,8 @@ class Singleton(Factory):
|
||||||
|
|
||||||
.. py:attribute:: provided_type
|
.. py:attribute:: provided_type
|
||||||
|
|
||||||
If provided type is defined, :py:class:`Factory` checks that
|
If provided type is defined, provider checks that providing class is
|
||||||
:py:attr:`Factory.provides` is subclass of
|
its subclass.
|
||||||
:py:attr:`Factory.provided_type`.
|
|
||||||
|
|
||||||
:type: type | None
|
:type: type | None
|
||||||
|
|
||||||
|
@ -222,16 +217,12 @@ class Singleton(Factory):
|
||||||
|
|
||||||
|
|
||||||
class DelegatedSingleton(Singleton):
|
class DelegatedSingleton(Singleton):
|
||||||
""":py:class:`DelegatedSingleton` is a delegated :py:class:`Singleton`.
|
""":py:class:`Singleton` that is injected "as is".
|
||||||
|
|
||||||
:py:class:`DelegatedSingleton` is a :py:class:`Singleton`, that is injected
|
|
||||||
"as is".
|
|
||||||
|
|
||||||
.. py:attribute:: provided_type
|
.. py:attribute:: provided_type
|
||||||
|
|
||||||
If provided type is defined, :py:class:`Factory` checks that
|
If provided type is defined, provider checks that providing class is
|
||||||
:py:attr:`Factory.provides` is subclass of
|
its subclass.
|
||||||
:py:attr:`Factory.provided_type`.
|
|
||||||
|
|
||||||
:type: type | None
|
:type: type | None
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ Development version
|
||||||
-------------------
|
-------------------
|
||||||
- Add ``ThreadLocalSingleton`` and ``DelegatedThreadLocalSingleton`` providers.
|
- Add ``ThreadLocalSingleton`` and ``DelegatedThreadLocalSingleton`` providers.
|
||||||
- Add documentation section about singleton providers and multi-threading.
|
- Add documentation section about singleton providers and multi-threading.
|
||||||
|
- Update API docs of creational providers.
|
||||||
|
|
||||||
2.0.0
|
2.0.0
|
||||||
------
|
------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user