diff --git a/third_party/2/requests/models.pyi b/third_party/2/requests/models.pyi index 009492c40..a9f2b59f4 100644 --- a/third_party/2/requests/models.pyi +++ b/third_party/2/requests/models.pyi @@ -17,6 +17,8 @@ from . import utils from . import compat from . import status_codes +from typing import Optional, Union + default_hooks = hooks.default_hooks CaseInsensitiveDict = structures.CaseInsensitiveDict HTTPBasicAuth = auth.HTTPBasicAuth @@ -77,10 +79,10 @@ class Request(RequestHooksMixin): def prepare(self): ... class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): - method = ... # type: str - url = ... # type: str - headers = ... # type: Dict[str, str] - body = ... # type: str + method = ... # type: Optional[Union[str, unicode]] + url = ... # type: Optional[Union[str, unicode]] + headers = ... # type: CaseInsensitiveDict + body = ... # type: Optional[Union[str, unicode]] hooks = ... # type: Any def __init__(self) -> None: ... def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=..., diff --git a/third_party/2/requests/structures.pyi b/third_party/2/requests/structures.pyi index 837cf2501..a7f77b238 100644 --- a/third_party/2/requests/structures.pyi +++ b/third_party/2/requests/structures.pyi @@ -1,18 +1,9 @@ # Stubs for requests.structures (Python 3) -from typing import Any -import collections +from typing import Any, Iterator, MutableMapping, Tuple, Union -class CaseInsensitiveDict(collections.MutableMapping): - def __init__(self, data=..., **kwargs) -> None: ... - def __setitem__(self, key, value): ... - def __getitem__(self, key): ... - def __delitem__(self, key): ... - def __iter__(self): ... - def __len__(self): ... - def lower_items(self): ... - def __eq__(self, other): ... - def copy(self): ... +class CaseInsensitiveDict(MutableMapping[str, Union[str, unicode]]): + def lower_items(self) -> Iterator[Tuple[str, Union[str, unicode]]]: ... class LookupDict(dict): name = ... # type: Any diff --git a/third_party/3/requests/models.pyi b/third_party/3/requests/models.pyi index 1e30de97f..7789899dc 100644 --- a/third_party/3/requests/models.pyi +++ b/third_party/3/requests/models.pyi @@ -17,6 +17,8 @@ from . import utils from . import compat from . import status_codes +from typing import Optional, Union + default_hooks = hooks.default_hooks CaseInsensitiveDict = structures.CaseInsensitiveDict HTTPBasicAuth = auth.HTTPBasicAuth @@ -78,10 +80,10 @@ class Request(RequestHooksMixin): def prepare(self): ... class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): - method = ... # type: str - url = ... # type: str - headers = ... # type: Dict[str, str] - body = ... # type: str + method = ... # type: Optional[str] + url = ... # type: Optional[str] + headers = ... # type: CaseInsensitiveDict + body = ... # type: Optional[Union[str, bytes]] hooks = ... # type: Any def __init__(self) -> None: ... def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=..., diff --git a/third_party/3/requests/structures.pyi b/third_party/3/requests/structures.pyi index 837cf2501..af4273bfd 100644 --- a/third_party/3/requests/structures.pyi +++ b/third_party/3/requests/structures.pyi @@ -1,18 +1,9 @@ # Stubs for requests.structures (Python 3) -from typing import Any -import collections +from typing import Any, Iterator, MutableMapping, Tuple, Union -class CaseInsensitiveDict(collections.MutableMapping): - def __init__(self, data=..., **kwargs) -> None: ... - def __setitem__(self, key, value): ... - def __getitem__(self, key): ... - def __delitem__(self, key): ... - def __iter__(self): ... - def __len__(self): ... - def lower_items(self): ... - def __eq__(self, other): ... - def copy(self): ... +class CaseInsensitiveDict(MutableMapping[str, Union[str, bytes]]): + def lower_items(self) -> Iterator[Tuple[str, Union[str, bytes]]]: ... class LookupDict(dict): name = ... # type: Any