mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-06-20 13:33:13 +03:00
Return types module with deprecation warning
This commit is contained in:
parent
b749f18b96
commit
c3981b02fc
18
src/dependency_injector/types.py
Normal file
18
src/dependency_injector/types.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from typing import TypeVar, Generic, Any
|
||||
import warnings
|
||||
|
||||
|
||||
warnings.warn(
|
||||
message=(
|
||||
'Types module is deprecated since version 3.44.0. Use "Provider" class from the '
|
||||
'"providers" module: providers.Provider[SomeClass]'
|
||||
),
|
||||
category=DeprecationWarning,
|
||||
)
|
||||
|
||||
Injection = Any
|
||||
T = TypeVar('T')
|
||||
|
||||
|
||||
class Provider(Generic[T]):
|
||||
def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
|
Loading…
Reference in New Issue
Block a user