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,5 +1,5 @@
from _typeshed import Self
from typing import IO, Any, AnyStr, List, Mapping, Sequence, Text, Tuple
from typing import IO, Any, AnyStr, Mapping, Sequence, Text
def url2pathname(pathname: AnyStr) -> AnyStr: ...
def pathname2url(pathname: AnyStr) -> AnyStr: ...
@@ -82,7 +82,7 @@ class addbase:
fp: Any
def read(self, n: int = ...) -> bytes: ...
def readline(self, limit: int = ...) -> bytes: ...
def readlines(self, hint: int = ...) -> List[bytes]: ...
def readlines(self, hint: int = ...) -> list[bytes]: ...
def fileno(self) -> int: ... # Optional[int], but that is rare
def __iter__(self: Self) -> Self: ...
def next(self) -> bytes: ...
@@ -124,7 +124,7 @@ def unquote(s: AnyStr) -> AnyStr: ...
def unquote_plus(s: AnyStr) -> AnyStr: ...
def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ...
def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ...
def urlencode(query: Sequence[Tuple[Any, Any]] | Mapping[Any, Any], doseq=...) -> str: ...
def urlencode(query: Sequence[tuple[Any, Any]] | Mapping[Any, Any], doseq=...) -> str: ...
def getproxies() -> Mapping[str, str]: ...
def proxy_bypass(host: str) -> Any: ... # undocumented