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 _typeshed import SupportsGetItem, SupportsItemAccess
from builtins import type as _type
from typing import IO, Any, AnyStr, Iterable, Iterator, List, Mapping, Protocol
from builtins import list as List, type as _type # aliases to avoid name clashes with `FieldStorage` attributes
from typing import IO, Any, AnyStr, Iterable, Iterator, Mapping, Protocol
from UserDict import UserDict
def parse(
@@ -8,10 +8,10 @@ def parse(
environ: SupportsItemAccess[str, str] = ...,
keep_blank_values: bool = ...,
strict_parsing: bool = ...,
) -> dict[str, List[str]]: ...
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> dict[str, List[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> List[tuple[str, str]]: ...
def parse_multipart(fp: IO[Any], pdict: SupportsGetItem[str, bytes]) -> dict[str, List[bytes]]: ...
) -> dict[str, list[str]]: ...
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> dict[str, list[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> list[tuple[str, str]]: ...
def parse_multipart(fp: IO[Any], pdict: SupportsGetItem[str, bytes]) -> dict[str, list[bytes]]: ...
class _Environ(Protocol):
def __getitem__(self, __k: str) -> str: ...
@@ -86,7 +86,7 @@ class FieldStorage(object):
# In Python 2 it always returns bytes and ignores the "binary" flag
def make_file(self, binary: Any = ...) -> IO[bytes]: ...
class FormContentDict(UserDict[str, List[str]]):
class FormContentDict(UserDict[str, list[str]]):
query_string: str
def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...