Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,19 +1,19 @@
from _typeshed import SupportsRead
from typing import IO, Any, Callable, Iterable, Iterator, List, Tuple, Union
from typing import IO, Any, Callable, Iterable, Iterator, Union
Loader = Any
MetaPathFinder = Any
PathEntryFinder = Any
_ModuleInfoLike = Tuple[Union[MetaPathFinder, PathEntryFinder], str, bool]
_ModuleInfoLike = tuple[Union[MetaPathFinder, PathEntryFinder], str, bool]
def extend_path(path: List[str], name: str) -> List[str]: ...
def extend_path(path: list[str], name: str) -> list[str]: ...
class ImpImporter:
def __init__(self, path: str | None = ...) -> None: ...
class ImpLoader:
def __init__(self, fullname: str, file: IO[str], filename: str, etc: Tuple[str, str, int]) -> None: ...
def __init__(self, fullname: str, file: IO[str], filename: str, etc: tuple[str, str, int]) -> None: ...
def find_loader(fullname: str) -> Loader | None: ...
def get_importer(path_item: str) -> PathEntryFinder | None: ...