Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood
2022-03-16 15:01:33 +00:00
committed by GitHub
parent 15e21a8dc1
commit 3ab250eec8
174 changed files with 472 additions and 490 deletions

View File

@@ -3,17 +3,17 @@ import types
import zipimport
from _typeshed import Self
from abc import ABCMeta
from typing import IO, Any, Callable, Generator, Iterable, Optional, Sequence, TypeVar, Union, overload
from typing import IO, Any, Callable, Generator, Iterable, Sequence, TypeVar, overload
LegacyVersion = Any # from packaging.version
Version = Any # from packaging.version
_T = TypeVar("_T")
_NestedStr = Union[str, Iterable[Union[str, Iterable[Any]]]]
_InstallerType = Callable[[Requirement], Optional[Distribution]]
_EPDistType = Union[Distribution, Requirement, str]
_MetadataType = Optional[IResourceProvider]
_PkgReqType = Union[str, Requirement]
_NestedStr = str | Iterable[str | Iterable[Any]]
_InstallerType = Callable[[Requirement], Distribution | None]
_EPDistType = Distribution | Requirement | str
_MetadataType = IResourceProvider | None
_PkgReqType = str | Requirement
_DistFinderType = Callable[[_Importer, str, bool], Generator[Distribution, None, None]]
_NSHandlerType = Callable[[_Importer, str, str, types.ModuleType], str]