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,7 +1,7 @@
import os
import sys
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Sequence, Text, Tuple, TypeVar, overload
from typing import Any, AnyStr, Callable, Sequence, Text, TypeVar, overload
_T = TypeVar("_T")
@@ -74,11 +74,11 @@ def relpath(path: Text, start: Text | None = ...) -> Text: ...
def samefile(f1: Text, f2: Text) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def split(p: AnyStr) -> tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> tuple[AnyStr, AnyStr]: ...
if sys.platform == "win32":
def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated
def splitunc(p: AnyStr) -> tuple[AnyStr, AnyStr]: ... # deprecated
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, list[AnyStr]], Any], arg: _T) -> None: ...