From 098ecb4eec44628129cc15c64bbf194c3ca44a3a Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Mon, 7 Sep 2020 11:53:03 -0400 Subject: [PATCH] Fix declarative container mypy stub --- docs/main/changelog.rst | 1 + src/dependency_injector/containers.pyi | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index 9a67cd9f..bb2d8faf 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -10,6 +10,7 @@ follows `Semantic versioning`_ Develop ------- - Refactor "password hashing" example. +- Fix declarative container mypy stub to ``__init__`` to accept not only providers. 3.40.0 ------ diff --git a/src/dependency_injector/containers.pyi b/src/dependency_injector/containers.pyi index 62117b43..1c5346bf 100644 --- a/src/dependency_injector/containers.pyi +++ b/src/dependency_injector/containers.pyi @@ -24,7 +24,7 @@ class DynamicContainer(Container): ... class DeclarativeContainer(Container): cls_providers: ClassVar[Dict[str, Provider]] inherited_providers: ClassVar[Dict[str, Provider]] - def __init__(self, **overriding_providers: Provider) -> None: ... + def __init__(self, **overriding_providers: Union[Provider, Any]) -> None: ... def override(container: Container) -> _Callable[[Container], Container]: ...