diff --git a/setup.cfg b/setup.cfg index 2dff342..90c666c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,7 @@ python_requires = >=3.6 setup_requires = setuptools>=51.2.0 install_requires = - typing-extensions~=3.7; python_version<"3.8" + typing-extensions>=4.6.0 zip_safe = false include_package_data = true diff --git a/src/aiotools/types.py b/src/aiotools/types.py index 455ef33..ed44d88 100644 --- a/src/aiotools/types.py +++ b/src/aiotools/types.py @@ -7,6 +7,7 @@ Coroutine, Generator, TypeVar, + Union, ) from typing_extensions import TypeAlias @@ -17,5 +18,5 @@ AwaitableLike: TypeAlias = Awaitable[_T] # noqa: Y047 CoroutineLike: TypeAlias = Coroutine[Any, Any, _T] # noqa: Y047 else: - AwaitableLike: TypeAlias = Generator[Any, None, _T] | Awaitable[_T] - CoroutineLike: TypeAlias = Generator[Any, None, _T] | Coroutine[Any, Any, _T] + AwaitableLike: TypeAlias = Union[Generator[Any, None, _T], Awaitable[_T]] + CoroutineLike: TypeAlias = Union[Generator[Any, None, _T], Coroutine[Any, Any, _T]]