Use TypeAlias where possible for type aliases (#7630)

This commit is contained in:
Alex Waygood
2022-04-16 02:01:00 +01:00
committed by GitHub
parent c0e6dd3f3f
commit 740193a8fc
218 changed files with 760 additions and 625 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import sys
from _typeshed import SupportsRead
from typing import Any, Callable, Generic, MutableMapping, Pattern, Text, TypeVar, overload
from typing_extensions import TypeAlias
_MutableMappingT = TypeVar("_MutableMappingT", bound=MutableMapping[str, Any])
@@ -8,10 +9,10 @@ if sys.version_info >= (3, 0):
from pathlib import PurePath
FNFError = FileNotFoundError
_PathLike = str | bytes | PurePath
_PathLike: TypeAlias = str | bytes | PurePath
else:
FNFError = IOError
_PathLike = Text
_PathLike: TypeAlias = Text
TIME_RE: Pattern[str]