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]: ...