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,6 +1,6 @@
from random import Random
from thread import LockType
from typing import IO, Any, AnyStr, Iterable, Iterator, List, Text, Tuple, overload
from typing import IO, Any, AnyStr, Iterable, Iterator, Text, overload
TMP_MAX: int
tempdir: str
@@ -39,7 +39,7 @@ class _TemporaryFileWrapper(IO[str]):
def read(self, n: int = ...) -> str: ...
def readable(self) -> bool: ...
def readline(self, limit: int = ...) -> str: ...
def readlines(self, hint: int = ...) -> List[str]: ...
def readlines(self, hint: int = ...) -> list[str]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def seekable(self) -> bool: ...
def tell(self) -> int: ...
@@ -82,9 +82,9 @@ class TemporaryDirectory:
def __exit__(self, type, value, traceback) -> None: ...
@overload
def mkstemp() -> Tuple[int, str]: ...
def mkstemp() -> tuple[int, str]: ...
@overload
def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: AnyStr | None = ..., text: bool = ...) -> Tuple[int, AnyStr]: ...
def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: AnyStr | None = ..., text: bool = ...) -> tuple[int, AnyStr]: ...
@overload
def mkdtemp() -> str: ...
@overload
@@ -95,6 +95,6 @@ def mktemp() -> str: ...
def mktemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: AnyStr | None = ...) -> AnyStr: ...
def gettempdir() -> str: ...
def gettempprefix() -> str: ...
def _candidate_tempdir_list() -> List[str]: ...
def _candidate_tempdir_list() -> list[str]: ...
def _get_candidate_names() -> _RandomNameSequence | None: ...
def _get_default_tempdir() -> str: ...