From cb2a36b216f339ee8e1dd25b6a15c5391605aeb4 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Sat, 2 Jan 2021 23:32:23 -0500 Subject: [PATCH] Refactor Singleton typing stubs to return singleton from argument methods --- src/dependency_injector/providers.pyi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dependency_injector/providers.pyi b/src/dependency_injector/providers.pyi index 4a59e156..4d12072d 100644 --- a/src/dependency_injector/providers.pyi +++ b/src/dependency_injector/providers.pyi @@ -285,19 +285,19 @@ class BaseSingleton(Provider, Generic[T]): def cls(self) -> T: ... @property def args(self) -> Tuple[Injection]: ... - def add_args(self, *args: Injection) -> Factory[T]: ... - def set_args(self, *args: Injection) -> Factory[T]: ... - def clear_args(self) -> Factory[T]: ... + def add_args(self, *args: Injection) -> BaseSingleton[T]: ... + def set_args(self, *args: Injection) -> BaseSingleton[T]: ... + def clear_args(self) -> BaseSingleton[T]: ... @property def kwargs(self) -> _Dict[str, Injection]: ... - def add_kwargs(self, **kwargs: Injection) -> Factory[T]: ... - def set_kwargs(self, **kwargs: Injection) -> Factory[T]: ... - def clear_kwargs(self) -> Factory[T]: ... + def add_kwargs(self, **kwargs: Injection) -> BaseSingleton[T]: ... + def set_kwargs(self, **kwargs: Injection) -> BaseSingleton[T]: ... + def clear_kwargs(self) -> BaseSingleton[T]: ... @property def attributes(self) -> _Dict[str, Injection]: ... - def add_attributes(self, **kwargs: Injection) -> Factory[T]: ... - def set_attributes(self, **kwargs: Injection) -> Factory[T]: ... - def clear_attributes(self) -> Factory[T]: ... + def add_attributes(self, **kwargs: Injection) -> BaseSingleton[T]: ... + def set_attributes(self, **kwargs: Injection) -> BaseSingleton[T]: ... + def clear_attributes(self) -> BaseSingleton[T]: ... def reset(self) -> None: ...