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,4 +1,4 @@
from typing import AnyStr, Iterable, List
from typing import AnyStr, Iterable
whitespace: str
lowercase: str
@@ -8,7 +8,7 @@ digits: str
hexdigits: str
octdigits: str
_idmap: str
_idmapL: List[str] | None
_idmapL: list[str] | None
index_error = ValueError
atoi_error = ValueError
atof_error = ValueError
@@ -20,8 +20,8 @@ def swapcase(s: AnyStr) -> AnyStr: ...
def strip(s: AnyStr) -> AnyStr: ...
def lstrip(s: AnyStr) -> AnyStr: ...
def rstrip(s: AnyStr) -> AnyStr: ...
def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...
def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...
def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> list[AnyStr]: ...
def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> list[AnyStr]: ...
def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...
def joinfields(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...
def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...