mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Expansion of unions inside params definition (#848)
Due to `Dict` / `Mapping` invariance it's necessary to include other variants of `Union[str, bytes], Union[str, bytes]`.
This commit is contained in:
committed by
Łukasz Langa
parent
f2579e532f
commit
6178ed3201
14
third_party/2/requests/api.pyi
vendored
14
third_party/2/requests/api.pyi
vendored
@@ -1,18 +1,22 @@
|
||||
# Stubs for requests.api (Python 2)
|
||||
|
||||
from typing import Union, Optional, Iterable, Dict, Tuple
|
||||
from typing import Union, Optional, Iterable, Mapping, Tuple
|
||||
|
||||
from .models import Response
|
||||
|
||||
def request(method: str, url: str, **kwargs) -> Response: ...
|
||||
ParamsMappingValueType = Union[str, unicode, int, float, Iterable[Union[str, unicode, int, float]]]
|
||||
|
||||
def request(method: str, url: str, **kwargs) -> Response: ...
|
||||
def get(url: Union[str, unicode],
|
||||
params: Optional[
|
||||
Union[Dict[Union[str, unicode, int, float], Union[str, unicode, int, float, Iterable[Union[str, unicode, int, float]]]],
|
||||
Union[Mapping[Union[str, unicode, int, float], ParamsMappingValueType],
|
||||
Union[str, unicode],
|
||||
Tuple[Union[str, unicode, int, float], Union[str, unicode, int, float, Iterable[Union[str, unicode, int, float]]]]]] = None,
|
||||
Tuple[Union[str, unicode, int, float], ParamsMappingValueType],
|
||||
Mapping[str, ParamsMappingValueType],
|
||||
Mapping[unicode, ParamsMappingValueType],
|
||||
Mapping[int, ParamsMappingValueType],
|
||||
Mapping[float, ParamsMappingValueType]]] = None,
|
||||
**kwargs) -> Response: ...
|
||||
|
||||
def options(url: Union[str, unicode], **kwargs) -> Response: ...
|
||||
def head(url: Union[str, unicode], **kwargs) -> Response: ...
|
||||
def post(url: Union[str, unicode], data=..., json=...,
|
||||
|
||||
12
third_party/3/requests/api.pyi
vendored
12
third_party/3/requests/api.pyi
vendored
@@ -1,16 +1,22 @@
|
||||
# Stubs for requests.api (Python 3)
|
||||
|
||||
from typing import Optional, Union, Any, Iterable, Dict, Tuple
|
||||
from typing import Optional, Union, Any, Iterable, Mapping, Tuple
|
||||
|
||||
from .models import Response
|
||||
|
||||
ParamsMappingValueType = Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]
|
||||
|
||||
def request(method: str, url: str, **kwargs) -> Response: ...
|
||||
def get(url: Union[str, bytes],
|
||||
params: Optional[
|
||||
Union[
|
||||
Dict[Union[str, bytes, int, float], Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]],
|
||||
Mapping[Union[str, bytes, int, float], ParamsMappingValueType],
|
||||
Union[str, bytes],
|
||||
Tuple[Union[str, bytes, int, float], Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]]]] = None,
|
||||
Tuple[Union[str, bytes, int, float], ParamsMappingValueType],
|
||||
Mapping[str, ParamsMappingValueType],
|
||||
Mapping[bytes, ParamsMappingValueType],
|
||||
Mapping[int, ParamsMappingValueType],
|
||||
Mapping[float, ParamsMappingValueType]]]=None,
|
||||
**kwargs) -> Response: ...
|
||||
def options(url: str, **kwargs) -> Response: ...
|
||||
def head(url: str, **kwargs) -> Response: ...
|
||||
|
||||
Reference in New Issue
Block a user