Add overload for Factory typing

This commit is contained in:
Roman Mogylatov 2020-12-23 21:25:08 -05:00
parent b446dab559
commit 541641d36c

View File

@ -169,7 +169,10 @@ class Configuration(Object):
class Factory(Provider, Generic[T]):
provided_type: Optional[Type]
def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
def __call__(self, *args: Injection, **kwargs: Injection) -> Union[T, Awaitable[T]]: ...
@overload
def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
@overload
def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
@property
def cls(self) -> T: ...
@property