mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-10-31 07:57:43 +03:00 
			
		
		
		
	Add typing stubs for Callable, Factory, and Singleton .set_provides() attributes
This commit is contained in:
		
							parent
							
								
									41cf1bd6b4
								
							
						
					
					
						commit
						ce36033faa
					
				|  | @ -131,9 +131,10 @@ class DependenciesContainer(Object): | |||
| 
 | ||||
| 
 | ||||
| class Callable(Provider[T]): | ||||
|     def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ... | ||||
|     def __init__(self, provides: Optional[_Callable[..., T]] = None, *args: Injection, **kwargs: Injection) -> None: ... | ||||
|     @property | ||||
|     def provides(self) -> T: ... | ||||
|     def provides(self) -> Optional[T]: ... | ||||
|     def set_provides(self, provides: Optional[_Callable[..., T]]) -> None: ... | ||||
|     @property | ||||
|     def args(self) -> Tuple[Injection]: ... | ||||
|     def add_args(self, *args: Injection) -> Callable[T]: ... | ||||
|  | @ -221,11 +222,12 @@ class Configuration(Object[Any]): | |||
| 
 | ||||
| class Factory(Provider[T]): | ||||
|     provided_type: Optional[Type] | ||||
|     def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ... | ||||
|     def __init__(self, provides: Optional[_Callable[..., T]] = None, *args: Injection, **kwargs: Injection) -> None: ... | ||||
|     @property | ||||
|     def cls(self) -> T: ... | ||||
|     @property | ||||
|     def provides(self) -> T: ... | ||||
|     def set_provides(self, provides: Optional[_Callable[..., T]]) -> None: ... | ||||
|     @property | ||||
|     def args(self) -> Tuple[Injection]: ... | ||||
|     def add_args(self, *args: Injection) -> Factory[T]: ... | ||||
|  | @ -270,11 +272,12 @@ class FactoryAggregate(Provider): | |||
| 
 | ||||
| class BaseSingleton(Provider[T]): | ||||
|     provided_type = Optional[Type] | ||||
|     def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ... | ||||
|     def __init__(self, provides: Optional[_Callable[..., T]] = None, *args: Injection, **kwargs: Injection) -> None: ... | ||||
|     @property | ||||
|     def cls(self) -> T: ... | ||||
|     @property | ||||
|     def provides(self) -> T: ... | ||||
|     def set_provides(self, provides: Optional[_Callable[..., T]]) -> None: ... | ||||
|     @property | ||||
|     def args(self) -> Tuple[Injection]: ... | ||||
|     def add_args(self, *args: Injection) -> BaseSingleton[T]: ... | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user