Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 09:26:35 -07:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import Any, Iterable, List, Mapping, Set, Text
from typing import Any, Iterable, Mapping, Set, Text
from ..middleware.proxy_fix import ProxyFix as ProxyFix
@@ -19,7 +19,7 @@ class PathInfoFromRequestUriFix(object):
class HeaderRewriterFix(object):
app: WSGIApplication
remove_headers: Set[Text]
add_headers: List[Text]
add_headers: list[Text]
def __init__(
self, app: WSGIApplication, remove_headers: Iterable[Text] | None = ..., add_headers: Iterable[Text] | None = ...
) -> None: ...
+3 -3
View File
@@ -36,7 +36,7 @@ def native_itermethods(names): ...
class ImmutableListMixin(Generic[_V]):
def __hash__(self) -> int: ...
def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], List[_V]]: ...
def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], list[_V]]: ...
def __delitem__(self, key: _V) -> NoReturn: ...
def __iadd__(self, other: Any) -> NoReturn: ...
def __imul__(self, other: Any) -> NoReturn: ...
@@ -284,7 +284,7 @@ class Accept(ImmutableList[Tuple[str, float]]):
@overload
def __getitem__(self, key: SupportsIndex) -> Tuple[str, float]: ...
@overload
def __getitem__(self, s: slice) -> List[Tuple[str, float]]: ...
def __getitem__(self, s: slice) -> list[Tuple[str, float]]: ...
@overload
def __getitem__(self, key: str) -> float: ...
def quality(self, key: str) -> float: ...
@@ -465,7 +465,7 @@ class FileStorage(object):
@property
def mimetype(self) -> str: ...
@property
def mimetype_params(self) -> Dict[str, str]: ...
def mimetype_params(self) -> dict[str, str]: ...
def save(self, dst: Text | SupportsWrite[bytes], buffer_size: int = ...): ...
def close(self) -> None: ...
def __nonzero__(self) -> bool: ...
+4 -4
View File
@@ -1,6 +1,6 @@
import datetime
from _typeshed.wsgi import StartResponse, WSGIEnvironment
from typing import Any, Dict, Iterable, List, NoReturn, Protocol, Text, Tuple, Type
from typing import Any, Iterable, NoReturn, Protocol, Text, Tuple, Type
from werkzeug.wrappers import Response
@@ -19,11 +19,11 @@ class HTTPException(Exception):
def name(self) -> str: ...
def get_description(self, environ: WSGIEnvironment | None = ...) -> Text: ...
def get_body(self, environ: WSGIEnvironment | None = ...) -> Text: ...
def get_headers(self, environ: WSGIEnvironment | None = ...) -> List[Tuple[str, str]]: ...
def get_headers(self, environ: WSGIEnvironment | None = ...) -> list[Tuple[str, str]]: ...
def get_response(self, environ: WSGIEnvironment | _EnvironContainer | None = ...) -> Response: ...
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
default_exceptions: Dict[int, Type[HTTPException]]
default_exceptions: dict[int, Type[HTTPException]]
class BadRequest(HTTPException):
code: int
@@ -41,7 +41,7 @@ class Unauthorized(HTTPException):
self,
description: Text | None = ...,
response: Response | None = ...,
www_authenticate: None | Tuple[object, ...] | List[object] | object = ...,
www_authenticate: None | Tuple[object, ...] | list[object] | object = ...,
) -> None: ...
class Forbidden(HTTPException):
+2 -2
View File
@@ -1,5 +1,5 @@
from _typeshed.wsgi import WSGIEnvironment
from typing import IO, Any, Callable, Dict, Generator, Iterable, Mapping, NoReturn, Optional, Protocol, Text, Tuple, TypeVar
from typing import IO, Any, Callable, Generator, Iterable, Mapping, NoReturn, Optional, Protocol, Text, Tuple, TypeVar
from .datastructures import Headers
@@ -51,7 +51,7 @@ class FormDataParser(object):
def parse(
self, stream: IO[bytes], mimetype: Text, content_length: int | None, options: Mapping[str, str] | None = ...
) -> Tuple[IO[bytes], _Dict, _Dict]: ...
parse_functions: Dict[Text, _ParseFunc]
parse_functions: dict[Text, _ParseFunc]
def is_valid_multipart_boundary(boundary: str) -> bool: ...
def parse_multipart_headers(iterable: Iterable[Text | bytes]) -> Headers: ...
@@ -1,12 +1,12 @@
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import Any, Dict, Iterable, Mapping, MutableMapping, Text
from typing import Any, Iterable, Mapping, MutableMapping, Text
_Opts = Mapping[Text, Any]
_MutableOpts = MutableMapping[Text, Any]
class ProxyMiddleware(object):
app: WSGIApplication
targets: Dict[Text, _MutableOpts]
targets: dict[Text, _MutableOpts]
def __init__(
self, app: WSGIApplication, targets: Mapping[Text, _MutableOpts], chunk_size: int = ..., timeout: int = ...
) -> None: ...
+5 -5
View File
@@ -1,7 +1,7 @@
import sys
from _typeshed import SupportsWrite
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import Any, Iterable, Iterator, List, Mapping, Protocol, Tuple
from typing import Any, Iterable, Iterator, Mapping, Protocol, Tuple
from ..datastructures import Headers
@@ -36,14 +36,14 @@ class ErrorStream(object):
def close(self) -> None: ...
class GuardedWrite(object):
def __init__(self, write: SupportsWrite[str], chunks: List[int]) -> None: ...
def __init__(self, write: SupportsWrite[str], chunks: list[int]) -> None: ...
def __call__(self, s: str) -> None: ...
class GuardedIterator(object):
closed: bool
headers_set: bool
chunks: List[int]
def __init__(self, iterator: Iterable[str], headers_set: bool, chunks: List[int]) -> None: ...
chunks: list[int]
def __init__(self, iterator: Iterable[str], headers_set: bool, chunks: list[int]) -> None: ...
def __iter__(self) -> GuardedIterator: ...
if sys.version_info >= (3, 0):
def __next__(self) -> str: ...
@@ -55,7 +55,7 @@ class LintMiddleware(object):
def __init__(self, app: WSGIApplication) -> None: ...
def check_environ(self, environ: WSGIEnvironment) -> None: ...
def check_start_response(
self, status: str, headers: List[Tuple[str, str]], exc_info: Tuple[Any, ...] | None
self, status: str, headers: list[Tuple[str, str]], exc_info: Tuple[Any, ...] | None
) -> Tuple[int, Headers]: ...
def check_headers(self, headers: Mapping[str, str]) -> None: ...
def check_iterator(self, app_iter: Iterable[bytes]) -> None: ...
@@ -1,5 +1,5 @@
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import IO, Iterable, List, Text, Tuple
from typing import IO, Iterable, Text, Tuple
class ProfilerMiddleware(object):
def __init__(
@@ -11,4 +11,4 @@ class ProfilerMiddleware(object):
profile_dir: Text | None = ...,
filename_format: Text = ...,
) -> None: ...
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ...
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ...
@@ -1,6 +1,6 @@
import datetime
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import IO, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Union
from typing import IO, Callable, Iterable, Mapping, Optional, Text, Tuple, Union
_V = Union[Tuple[Text, Text], Text]
@@ -9,7 +9,7 @@ _Loader = Callable[[Optional[Text]], Union[Tuple[None, None], Tuple[Text, _Opene
class SharedDataMiddleware(object):
app: WSGIApplication
exports: List[Tuple[Text, _Loader]]
exports: list[Tuple[Text, _Loader]]
cache: bool
cache_timeout: float
def __init__(