From ae881faaf1ecc8190fd2f88c197c75e2ca5725de Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 29 Aug 2019 17:51:59 +0200 Subject: [PATCH] Remove custom _Text type (#3211) * Remove custom _Text type Since the custom type was only used in argument types, it was effectively only an alias for typing.Text. * Run requests/api.pyi through black --- third_party/2and3/requests/api.pyi | 54 +++++++++++++----------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/third_party/2and3/requests/api.pyi b/third_party/2and3/requests/api.pyi index 09c3d4f54..e6f3417c2 100644 --- a/third_party/2and3/requests/api.pyi +++ b/third_party/2and3/requests/api.pyi @@ -5,36 +5,28 @@ from typing import Optional, Union, Any, Iterable, Mapping, MutableMapping, Tupl from .models import Response -if sys.version_info >= (3,): - _Text = str -else: - _Text = Union[str, Text] - -_ParamsMappingValueType = Union[_Text, bytes, int, float, Iterable[Union[_Text, bytes, int, float]]] -_Data = Union[ - None, - _Text, - bytes, - MutableMapping[str, Any], - MutableMapping[Text, Any], - Iterable[Tuple[_Text, Optional[_Text]]], - IO -] +_ParamsMappingValueType = Union[Text, bytes, int, float, Iterable[Union[Text, bytes, int, float]]] +_Data = Union[None, Text, bytes, MutableMapping[str, Any], MutableMapping[Text, Any], Iterable[Tuple[Text, Optional[Text]]], IO] def request(method: str, url: str, **kwargs) -> Response: ... -def get(url: Union[_Text, bytes], - params: Optional[ - Union[Mapping[Union[_Text, bytes, int, float], _ParamsMappingValueType], - Union[_Text, bytes], - Tuple[Union[_Text, bytes, int, float], _ParamsMappingValueType], - Mapping[_Text, _ParamsMappingValueType], - Mapping[bytes, _ParamsMappingValueType], - Mapping[int, _ParamsMappingValueType], - Mapping[float, _ParamsMappingValueType]]] = ..., - **kwargs) -> Response: ... -def options(url: Union[_Text, bytes], **kwargs) -> Response: ... -def head(url: Union[_Text, bytes], **kwargs) -> Response: ... -def post(url: Union[_Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... -def put(url: Union[_Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... -def patch(url: Union[_Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... -def delete(url: Union[_Text, bytes], **kwargs) -> Response: ... +def get( + url: Union[Text, bytes], + params: Optional[ + Union[ + Mapping[Union[Text, bytes, int, float], _ParamsMappingValueType], + Union[Text, bytes], + Tuple[Union[Text, bytes, int, float], _ParamsMappingValueType], + Mapping[Text, _ParamsMappingValueType], + Mapping[bytes, _ParamsMappingValueType], + Mapping[int, _ParamsMappingValueType], + Mapping[float, _ParamsMappingValueType], + ] + ] = ..., + **kwargs, +) -> Response: ... +def options(url: Union[Text, bytes], **kwargs) -> Response: ... +def head(url: Union[Text, bytes], **kwargs) -> Response: ... +def post(url: Union[Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... +def put(url: Union[Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... +def patch(url: Union[Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... +def delete(url: Union[Text, bytes], **kwargs) -> Response: ...