lowercase list and dict for 3rd party stubs (#5893)

* stubs/decorator/decorator.pyi

* stubs/frozendict/frozendict.pyi

* stubs/Jinja2/jinja2/nodes.pyi

* stubs/Pygments/pygments/token.pyi

* stubs/requests/requests/models.pyi

* stubs/Werkzeug/werkzeug/http.pyi
This commit is contained in:
Akuli
2021-08-08 13:25:18 -07:00
committed by GitHub
parent 64903b85d7
commit 191aac3b0e
6 changed files with 36 additions and 35 deletions
+13 -13
View File
@@ -1,7 +1,7 @@
import sys
from _typeshed.wsgi import WSGIEnvironment
from datetime import datetime, timedelta
from typing import Any, Callable, Dict, Iterable, List, Mapping, SupportsInt, Text, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, Iterable, Mapping, SupportsInt, Text, Tuple, Type, TypeVar, Union, overload
from .datastructures import (
Accept,
@@ -29,41 +29,41 @@ else:
_T = TypeVar("_T")
_U = TypeVar("_U")
HTTP_STATUS_CODES: Dict[int, str]
HTTP_STATUS_CODES: dict[int, str]
def wsgi_to_bytes(data: bytes | Text) -> bytes: ...
def bytes_to_wsgi(data: bytes) -> str: ...
def quote_header_value(value: Any, extra_chars: str = ..., allow_token: bool = ...) -> str: ...
def unquote_header_value(value: _Str, is_filename: bool = ...) -> _Str: ...
def dump_options_header(header: _Str | None, options: Mapping[_Str, Any]) -> _Str: ...
def dump_header(iterable: Iterable[Any] | Dict[_Str, Any], allow_token: bool = ...) -> _Str: ...
def parse_list_header(value: _Str) -> List[_Str]: ...
def dump_header(iterable: Iterable[Any] | dict[_Str, Any], allow_token: bool = ...) -> _Str: ...
def parse_list_header(value: _Str) -> list[_Str]: ...
@overload
def parse_dict_header(value: bytes | Text) -> Dict[Text, Text | None]: ...
def parse_dict_header(value: bytes | Text) -> dict[Text, Text | None]: ...
@overload
def parse_dict_header(value: bytes | Text, cls: Type[_T]) -> _T: ...
@overload
def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, str | None]]: ...
def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, dict[str, str | None]]: ...
@overload
def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, _Str | None]]: ...
def parse_options_header(value: _Str) -> Tuple[_Str, dict[_Str, _Str | None]]: ...
# actually returns Tuple[_Str, Dict[_Str, _Str | None], ...]
# actually returns Tuple[_Str, dict[_Str, _Str | None], ...]
@overload
def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]: ...
@overload
def parse_accept_header(value: Text | None) -> Accept: ...
@overload
def parse_accept_header(value: _Str | None, cls: Callable[[List[Tuple[str, float]] | None], _T]) -> _T: ...
def parse_accept_header(value: _Str | None, cls: Callable[[list[Tuple[str, float]] | None], _T]) -> _T: ...
@overload
def parse_cache_control_header(
value: None | bytes | Text, on_update: Callable[[RequestCacheControl], Any] | None = ...
) -> RequestCacheControl: ...
@overload
def parse_cache_control_header(
value: None | bytes | Text, on_update: _T, cls: Callable[[Dict[Text, Text | None], _T], _U]
value: None | bytes | Text, on_update: _T, cls: Callable[[dict[Text, Text | None], _T], _U]
) -> _U: ...
@overload
def parse_cache_control_header(value: None | bytes | Text, *, cls: Callable[[Dict[Text, Text | None], None], _U]) -> _U: ...
def parse_cache_control_header(value: None | bytes | Text, *, cls: Callable[[dict[Text, Text | None], None], _U]) -> _U: ...
def parse_set_header(value: Text, on_update: Callable[[HeaderSet], Any] | None = ...) -> HeaderSet: ...
def parse_authorization_header(value: None | bytes | Text) -> Authorization | None: ...
def parse_www_authenticate_header(
@@ -90,8 +90,8 @@ def is_resource_modified(
last_modified: None | Text | datetime = ...,
ignore_if_range: bool = ...,
) -> bool: ...
def remove_entity_headers(headers: List[Tuple[Text, Text]] | Headers, allowed: Iterable[Text] = ...) -> None: ...
def remove_hop_by_hop_headers(headers: List[Tuple[Text, Text]] | Headers) -> None: ...
def remove_entity_headers(headers: list[Tuple[Text, Text]] | Headers, allowed: Iterable[Text] = ...) -> None: ...
def remove_hop_by_hop_headers(headers: list[Tuple[Text, Text]] | Headers) -> None: ...
def is_entity_header(header: Text) -> bool: ...
def is_hop_by_hop_header(header: Text) -> bool: ...
@overload