mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
add missing types to some arguments in third_party/3 (#994)
This commit is contained in:
committed by
Guido van Rossum
parent
45f4a1e913
commit
f35f6860f3
2
third_party/3.6/click/termui.pyi
vendored
2
third_party/3.6/click/termui.pyi
vendored
@@ -63,7 +63,7 @@ _T = TypeVar('_T')
|
||||
|
||||
@contextmanager
|
||||
def progressbar(
|
||||
iterable=Iterable[_T],
|
||||
iterable: Optional[Iterable[_T]] = None,
|
||||
length: int = None,
|
||||
label: str = None,
|
||||
show_eta: bool = True,
|
||||
|
||||
2
third_party/3/dateutil/parser.pyi
vendored
2
third_party/3/dateutil/parser.pyi
vendored
@@ -41,7 +41,7 @@ class parser(object):
|
||||
DEFAULTPARSER = ... # type: parser
|
||||
|
||||
|
||||
def parse(timestr, parserinfo: parserinfo=..., **kwargs) -> datetime:
|
||||
def parse(timestr: Union[str, bytes, IO[Any]], parserinfo: parserinfo=..., **kwargs) -> datetime:
|
||||
...
|
||||
|
||||
|
||||
|
||||
2
third_party/3/dateutil/tz/_common.pyi
vendored
2
third_party/3/dateutil/tz/_common.pyi
vendored
@@ -6,7 +6,7 @@ from typing import Any, Optional
|
||||
from datetime import datetime, tzinfo, timedelta
|
||||
|
||||
def tzname_in_python2(namefunc): ...
|
||||
def enfold(dt, fold: int = ...): ...
|
||||
def enfold(dt: datetime, fold: int = ...): ...
|
||||
|
||||
class _DatetimeWithFold(datetime):
|
||||
@property
|
||||
|
||||
2
third_party/3/dateutil/tz/tz.pyi
vendored
2
third_party/3/dateutil/tz/tz.pyi
vendored
@@ -70,7 +70,7 @@ class tzrange(tzrangebase):
|
||||
|
||||
class tzstr(tzrange):
|
||||
hasdst = ... # type: bool
|
||||
def __init__(self, s, posix_offset: bool = ...) -> None: ...
|
||||
def __init__(self, s: Union[bytes, str, IO[str]], posix_offset: bool = ...) -> None: ...
|
||||
|
||||
class tzical:
|
||||
def __init__(self, fileobj: Union[str, IO[str]]) -> None: ...
|
||||
|
||||
31
third_party/3/itsdangerous.pyi
vendored
31
third_party/3/itsdangerous.pyi
vendored
@@ -15,6 +15,7 @@ _bytes_like = Union[bytearray, bytes]
|
||||
_str_like = Union[str, bytes]
|
||||
_can_become_bytes = Union[str, bytes, bytearray]
|
||||
_comparable_bytes = TypeVar('_comparable_bytes', str, _bytes_like)
|
||||
_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module)
|
||||
|
||||
class _CompactJSON:
|
||||
def loads(self, payload: Text) -> Any: ...
|
||||
@@ -23,8 +24,8 @@ class _CompactJSON:
|
||||
compact_json = _CompactJSON
|
||||
EPOCH = ... # type: int
|
||||
|
||||
def want_bytes(s: _can_become_bytes, encoding='', errors='') -> bytes: ...
|
||||
def is_text_serializer(serializer: Any) -> bool: ...
|
||||
def want_bytes(s: _can_become_bytes, encoding: str='', errors: str='') -> bytes: ...
|
||||
def is_text_serializer(serializer: _serializer) -> bool: ...
|
||||
def constant_time_compare(val1: _comparable_bytes, val2: _comparable_bytes) -> bool: ...
|
||||
|
||||
class BadData(Exception):
|
||||
@@ -41,7 +42,7 @@ class BadSignature(BadData):
|
||||
|
||||
class BadTimeSignature(BadSignature):
|
||||
date_signed = ... # type: Optional[int]
|
||||
def __init__(self, message, payload: Optional[Any]=None, date_signed: Optional[int]=None) -> None: ...
|
||||
def __init__(self, message: str, payload: Optional[Any]=None, date_signed: Optional[int]=None) -> None: ...
|
||||
|
||||
class BadHeader(BadSignature):
|
||||
header = ... # type: Any
|
||||
@@ -92,20 +93,20 @@ class TimestampSigner(Signer):
|
||||
def get_timestamp(self) -> int: ...
|
||||
def timestamp_to_datetime(self, ts: int) -> datetime: ...
|
||||
def sign(self, value: _bytes_like) -> bytes: ...
|
||||
def unsign(self, value: _can_become_bytes, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def unsign(self, value: _can_become_bytes, max_age: Optional[int]=None, return_timestamp: bool=False) -> Any: ...
|
||||
def validate(self, signed_value: _can_become_bytes, max_age: Optional[int]=None) -> bool: ...
|
||||
|
||||
class Serializer:
|
||||
default_serializer = ... # type: Any
|
||||
default_serializer = ... # type: _serializer
|
||||
default_signer = ... # type: Callable[..., Signer]
|
||||
secret_key = ... # type: Any
|
||||
salt = ... # type: _can_become_bytes
|
||||
serializer = ... # type: Any
|
||||
serializer = ... # type: _serializer
|
||||
is_text_serializer = ... # type: bool
|
||||
signer = ... # type: Signer
|
||||
signer_kwargs = ... # type: MutableMapping
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=b'', serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, serializer=None) -> Any: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=b'', serializer: _serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, serializer: _serializer=None) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> bytes: ...
|
||||
def make_signer(self, salt: Optional[_can_become_bytes]=None) -> Signer: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes]=None) -> _str_like: ...
|
||||
@@ -117,7 +118,7 @@ class Serializer:
|
||||
|
||||
class TimedSerializer(Serializer):
|
||||
default_signer = ... # type: Callable[..., TimestampSigner]
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, max_age: Optional[int]=None, return_timestamp: bool=False) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, max_age: Optional[int]=None) -> Tuple[bool, Any]: ...
|
||||
|
||||
class JSONWebSignatureSerializer(Serializer):
|
||||
@@ -126,22 +127,22 @@ class JSONWebSignatureSerializer(Serializer):
|
||||
default_serializer = ... # type: Any
|
||||
algorithm_name = ... # type: str
|
||||
algorithm = ... # type: Any
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=None, serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None, algorithm_name: Optional[str]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, return_header=False) -> Any: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=None, serializer: _serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None, algorithm_name: Optional[str]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, return_header: bool=False) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> bytes: ...
|
||||
def make_algorithm(self, algorithm_name: str) -> SigningAlgorithm: ...
|
||||
def make_signer(self, salt: Optional[_can_become_bytes]=None, algorithm_name: Optional[str]=None) -> Signer: ...
|
||||
def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes]=None, header_fields=Optional[MutableMapping]) -> str: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header=False) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header=False) -> Tuple[bool, Any]: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes]=None, header_fields: Optional[MutableMapping]=...) -> str: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header: bool=False) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header: bool=False) -> Tuple[bool, Any]: ...
|
||||
|
||||
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
|
||||
DEFAULT_EXPIRES_IN = ... # type: int
|
||||
expires_in = ... # type: int
|
||||
def __init__(self, secret_key: _can_become_bytes, expires_in: Optional[int]=None, **kwargs) -> None: ...
|
||||
def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header=False) -> Any: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header: bool=False) -> Any: ...
|
||||
def get_issue_date(self, header: MutableMapping) -> Optional[datetime]: ...
|
||||
def now(self) -> int: ...
|
||||
|
||||
|
||||
4
third_party/3/requests/adapters.pyi
vendored
4
third_party/3/requests/adapters.pyi
vendored
@@ -44,9 +44,9 @@ DEFAULT_RETRIES = ... # type: Any
|
||||
|
||||
class BaseAdapter:
|
||||
def __init__(self) -> None: ...
|
||||
def send(self, request: PreparedRequest, stream=False,
|
||||
def send(self, request: PreparedRequest, stream: bool=False,
|
||||
timeout: Union[None, float, Tuple[float, float]]=None,
|
||||
verify=False,
|
||||
verify: bool=False,
|
||||
cert: Union[None, Union[str, bytes], Container[Union[str, bytes]]]=None
|
||||
) -> Response: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
9
third_party/3/requests/api.pyi
vendored
9
third_party/3/requests/api.pyi
vendored
@@ -1,10 +1,11 @@
|
||||
# Stubs for requests.api (Python 3)
|
||||
|
||||
from typing import Optional, Union, Any, Iterable, Mapping, Tuple
|
||||
from typing import Optional, Union, Any, Iterable, Mapping, MutableMapping, Tuple, IO, Text
|
||||
|
||||
from .models import Response
|
||||
|
||||
_ParamsMappingValueType = Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]
|
||||
_Data = Union[None, bytes, MutableMapping[Text, Text], IO]
|
||||
|
||||
def request(method: str, url: str, **kwargs) -> Response: ...
|
||||
def get(url: Union[str, bytes],
|
||||
@@ -20,7 +21,7 @@ def get(url: Union[str, bytes],
|
||||
**kwargs) -> Response: ...
|
||||
def options(url: str, **kwargs) -> Response: ...
|
||||
def head(url: str, **kwargs) -> Response: ...
|
||||
def post(url: str, data=..., json=..., **kwargs) -> Response: ...
|
||||
def put(url: str, data=..., **kwargs) -> Response: ...
|
||||
def patch(url: str, data=..., **kwargs) -> Response: ...
|
||||
def post(url: str, data: _Data = ..., json: Optional[MutableMapping] = ..., **kwargs) -> Response: ...
|
||||
def put(url: str, data: _Data = ..., **kwargs) -> Response: ...
|
||||
def patch(url: str, data: _Data = ..., **kwargs) -> Response: ...
|
||||
def delete(url: str, **kwargs) -> Response: ...
|
||||
|
||||
36
third_party/3/requests/sessions.pyi
vendored
36
third_party/3/requests/sessions.pyi
vendored
@@ -55,6 +55,8 @@ class SessionRedirectMixin:
|
||||
def rebuild_auth(self, prepared_request, response): ...
|
||||
def rebuild_proxies(self, prepared_request, proxies): ...
|
||||
|
||||
_Data = Union[None, bytes, MutableMapping[Text, Text], IO]
|
||||
|
||||
class Session(SessionRedirectMixin):
|
||||
__attrs__ = ... # type: Any
|
||||
headers = ... # type: Optional[MutableMapping[Text, Text]]
|
||||
@@ -75,27 +77,27 @@ class Session(SessionRedirectMixin):
|
||||
def __exit__(self, *args) -> None: ...
|
||||
def prepare_request(self, request): ...
|
||||
def request(self, method: str, url: str,
|
||||
params, # type: Union[None, bytes, MutableMapping[Text, Text]]
|
||||
data, # type: Union[None, bytes, MutableMapping[Text, Text], IO]
|
||||
headers, # type: Optional[MutableMapping[Text, Text]]
|
||||
cookies, # type: Union[None, RequestsCookieJar, MutableMapping[Text, Text]]
|
||||
files, # type: Optional[MutableMapping[Text, IO]]
|
||||
auth, # type: Union[None, Tuple[Text, Text], Callable[[Request], Request]]
|
||||
timeout, # type: Union[None, float, Tuple[float, float]]
|
||||
allow_redirects, # type: Optional[bool]
|
||||
proxies, # type: Optional[MutableMapping[Text, Text]]
|
||||
hooks, # type: Optional[MutableMapping[Text, Callable[[Request], Any]]]
|
||||
stream, # type: Optional[bool]
|
||||
verify, # type: Optional[bool]
|
||||
cert, # type: Union[Text, Tuple[Text, Text], None]
|
||||
json # type: Optional[MutableMapping]
|
||||
params: Union[None, bytes, MutableMapping[Text, Text]] = ...,
|
||||
data: _Data = ...,
|
||||
headers: Optional[MutableMapping[Text, Text]] = ...,
|
||||
cookies: Union[None, RequestsCookieJar, MutableMapping[Text, Text]] = ...,
|
||||
files: Optional[MutableMapping[Text, IO]] = ...,
|
||||
auth: Union[None, Tuple[Text, Text], Callable[[Request], Request]] = ...,
|
||||
timeout: Union[None, float, Tuple[float, float]] = ...,
|
||||
allow_redirects: Optional[bool] = ...,
|
||||
proxies: Optional[MutableMapping[Text, Text]] = ...,
|
||||
hooks: Optional[MutableMapping[Text, Callable[[Request], Any]]] = ...,
|
||||
stream: Optional[bool] = ...,
|
||||
verify: Optional[bool] = ...,
|
||||
cert: Union[Text, Tuple[Text, Text], None] = ...,
|
||||
json: Optional[MutableMapping] = ...,
|
||||
) -> Response: ...
|
||||
def get(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def options(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def head(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def post(self, url: Union[str, bytes], data=..., json=..., **kwargs) -> Response: ...
|
||||
def put(self, url: Union[str, bytes], data=..., **kwargs) -> Response: ...
|
||||
def patch(self, url: Union[str, bytes], data=..., **kwargs) -> Response: ...
|
||||
def post(self, url: Union[str, bytes], data: _Data = ..., json: Optional[MutableMapping] = ..., **kwargs) -> Response: ...
|
||||
def put(self, url: Union[str, bytes], data: _Data = ..., **kwargs) -> Response: ...
|
||||
def patch(self, url: Union[str, bytes], data: _Data = ..., **kwargs) -> Response: ...
|
||||
def delete(self, url: Union[str, bytes], **kwargs) -> Response: ...
|
||||
def send(self, request, **kwargs): ...
|
||||
def merge_environment_settings(self, url, proxies, stream, verify, cert): ...
|
||||
|
||||
2
third_party/3/werkzeug/wrappers.pyi
vendored
2
third_party/3/werkzeug/wrappers.pyi
vendored
@@ -80,7 +80,7 @@ class BaseResponse:
|
||||
status = ... # type: str
|
||||
direct_passthrough = ... # type: bool
|
||||
response = ... # type: Iterable[bytes]
|
||||
def __init__(self, response: Union[Iterable[bytes], bytes]=None, status=Union[str, int], headers: Union[Headers, Mapping[str, str], Sequence[Tuple[str, str]]]=None, mimetype: str=None, content_type: str=None, direct_passthrough: bool=False) -> None: ...
|
||||
def __init__(self, response: Union[Iterable[bytes], bytes]=None, status: Union[str, int]=None, headers: Union[Headers, Mapping[str, str], Sequence[Tuple[str, str]]]=None, mimetype: str=None, content_type: str=None, direct_passthrough: bool=False) -> None: ...
|
||||
def call_on_close(self, func): ...
|
||||
@classmethod
|
||||
def force_type(cls, response, environ=None): ...
|
||||
|
||||
Reference in New Issue
Block a user