Return types module with deprecation warning

This commit is contained in:
Roman Mogylatov 2020-09-13 19:51:56 -04:00
parent b749f18b96
commit c3981b02fc

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