mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
Change more defaults to ... (#1729)
* codemod ': Any = None' ': Any = ...' * codemod ': (Union|Optional)([^=]+)\s+=\s+-?\d+' ': \1\2 = ...' * codemod ': (Union|Optional)([^=]+)\s*=\s*-?(None|False|True)' ': \1\2 = ...' * codemod ': (int|float|bool)\s*=\s*-?\d+' ': \1 = ...' * codemod ': (bool)\s*=\s*(False|True)' ': \1 = ...' * codemod ': Any\s*=\s*(False|True|None)' ': Any = ...'
This commit is contained in:
committed by
Matthias Kramm
parent
0080017d02
commit
83ca997140
@@ -9,7 +9,7 @@ class Shelf(collections.MutableMapping):
|
||||
def __len__(self) -> int: ...
|
||||
def has_key(self, key: Any) -> bool: ...
|
||||
def __contains__(self, key: Any) -> bool: ...
|
||||
def get(self, key: Any, default: Any = None) -> Any: ...
|
||||
def get(self, key: Any, default: Any = ...) -> Any: ...
|
||||
def __getitem__(self, key: Any) -> Any: ...
|
||||
def __setitem__(self, key: Any, value: Any) -> None: ...
|
||||
def __delitem__(self, key: Any) -> None: ...
|
||||
|
||||
@@ -115,7 +115,7 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
|
||||
@abstractmethod
|
||||
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ...,
|
||||
# TODO: tb should be TracebackType but that's defined in types
|
||||
tb: Any = None) -> _T_co: ...
|
||||
tb: Any = ...) -> _T_co: ...
|
||||
|
||||
@abstractmethod
|
||||
def close(self) -> None: ...
|
||||
|
||||
@@ -128,7 +128,7 @@ class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
|
||||
def http_error_407(self, req, fp, code, msg, headers): ...
|
||||
|
||||
class AbstractHTTPHandler(BaseHandler):
|
||||
def __init__(self, debuglevel: int=0) -> None: ...
|
||||
def __init__(self, debuglevel: int = ...) -> None: ...
|
||||
def do_request_(self, request): ...
|
||||
def do_open(self, http_class, req): ...
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ def gcd(a: Integral, b: Integral) -> Integral: ...
|
||||
class Fraction(Rational):
|
||||
@overload
|
||||
def __init__(self,
|
||||
numerator: Union[int, Rational] = 0,
|
||||
denominator: Optional[Union[int, Rational]] = 0,
|
||||
numerator: Union[int, Rational] = ...,
|
||||
denominator: Optional[Union[int, Rational]] = ...,
|
||||
*,
|
||||
_normalize: bool = ...) -> None: ...
|
||||
@overload
|
||||
|
||||
@@ -12,7 +12,7 @@ from typing import Any, Dict, List, Optional
|
||||
if sys.version_info >= (3, 4):
|
||||
class ModuleSpec:
|
||||
def __init__(self, name: str, loader: Optional['Loader'], *,
|
||||
origin: Optional[str] = ..., loader_state: Any = None,
|
||||
origin: Optional[str] = ..., loader_state: Any = ...,
|
||||
is_package: Optional[bool] = ...) -> None: ...
|
||||
name = ... # type: str
|
||||
loader = ... # type: Optional[Loader]
|
||||
|
||||
@@ -7,7 +7,7 @@ class Shelf(collections.MutableMapping):
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, key: Any) -> bool: ... # key should be str, but it would conflict with superclass's type signature
|
||||
def get(self, key: str, default: Any = None) -> Any: ...
|
||||
def get(self, key: str, default: Any = ...) -> Any: ...
|
||||
def __getitem__(self, key: str) -> Any: ...
|
||||
def __setitem__(self, key: str, value: Any) -> None: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
|
||||
@@ -181,7 +181,7 @@ if sys.version_info >= (3, 6):
|
||||
|
||||
@abstractmethod
|
||||
def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = ...,
|
||||
tb: Any = None) -> Awaitable[_T_co]: ...
|
||||
tb: Any = ...) -> Awaitable[_T_co]: ...
|
||||
|
||||
@abstractmethod
|
||||
def aclose(self) -> Awaitable[_T_co]: ...
|
||||
|
||||
@@ -38,9 +38,9 @@ if sys.version_info >= (3, 3):
|
||||
# expecting other classes (as is Mock's purpose)
|
||||
class NonCallableMock(Any): # type: ignore
|
||||
def __new__(cls, *args: Any, **kw: Any) -> Any: ...
|
||||
def __init__(self, spec: Optional[Any] = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., _spec_as_instance: Any = False, _eat_self: Optional[Any] = ..., unsafe: Any = False, **kwargs: Any) -> None: ...
|
||||
def __init__(self, spec: Optional[Any] = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., _spec_as_instance: Any = ..., _eat_self: Optional[Any] = ..., unsafe: Any = ..., **kwargs: Any) -> None: ...
|
||||
def attach_mock(self, mock: Any, attribute: Any) -> Any: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = ...) -> Any: ...
|
||||
return_value = ... # type: Any
|
||||
__class__ = ... # type: type
|
||||
called = ... # type: Any
|
||||
@@ -108,7 +108,7 @@ if sys.version_info >= (3, 3):
|
||||
in_dict = ... # type: Any
|
||||
values = ... # type: Any
|
||||
clear = ... # type: Any
|
||||
def __init__(self, in_dict: Any, values: Any = ..., clear: Any = False, **kwargs: Any) -> None: ...
|
||||
def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ...
|
||||
def __call__(self, f: Any) -> Any: ...
|
||||
def decorate_class(self, klass: Any) -> Any: ...
|
||||
def __enter__(self) -> Any: ...
|
||||
@@ -121,11 +121,11 @@ if sys.version_info >= (3, 3):
|
||||
|
||||
class NonCallableMagicMock(MagicMixin, NonCallableMock):
|
||||
def __init__(self) -> None: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = ...) -> Any: ...
|
||||
|
||||
class MagicMock(MagicMixin, Mock):
|
||||
def __init__(self, spec: Any = ..., spec_set: Any = ..., side_effect: Any = ..., return_value: Any = ..., wraps: Any = ..., name: Any = ..., **kwargs: Any) -> None: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = ...) -> Any: ...
|
||||
|
||||
class MagicProxy:
|
||||
name = ... # type: Any
|
||||
@@ -157,7 +157,7 @@ if sys.version_info >= (3, 3):
|
||||
|
||||
call = ... # type: Any
|
||||
|
||||
def create_autospec(spec: Any, spec_set: Any = False, instance: Any = False, _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
|
||||
class _SpecState:
|
||||
spec = ... # type: Any
|
||||
@@ -166,7 +166,7 @@ if sys.version_info >= (3, 3):
|
||||
parent = ... # type: Any
|
||||
instance = ... # type: Any
|
||||
name = ... # type: Any
|
||||
def __init__(self, spec: Any, spec_set: Any = False, parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = False) -> None: ...
|
||||
def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ...
|
||||
|
||||
def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ...
|
||||
|
||||
|
||||
52
third_party/2/itsdangerous.pyi
vendored
52
third_party/2/itsdangerous.pyi
vendored
@@ -26,15 +26,15 @@ class BadData(Exception):
|
||||
|
||||
class BadPayload(BadData):
|
||||
original_error = ... # type: Optional[Exception]
|
||||
def __init__(self, message: str, original_error: Optional[Exception]=None) -> None: ...
|
||||
def __init__(self, message: str, original_error: Optional[Exception] = ...) -> None: ...
|
||||
|
||||
class BadSignature(BadData):
|
||||
payload = ... # type: Optional[Any]
|
||||
def __init__(self, message: str, payload: Optional[Any]=None) -> None: ...
|
||||
def __init__(self, message: str, payload: Optional[Any] = ...) -> None: ...
|
||||
|
||||
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, payload: Optional[Any] = ..., date_signed: Optional[int] = ...) -> None: ...
|
||||
|
||||
class BadHeader(BadSignature):
|
||||
header = ... # type: Any
|
||||
@@ -58,7 +58,7 @@ class NoneAlgorithm(SigningAlgorithm):
|
||||
class HMACAlgorithm(SigningAlgorithm):
|
||||
default_digest_method = ... # type: Callable
|
||||
digest_method = ... # type: Callable
|
||||
def __init__(self, digest_method: Optional[Callable]=None) -> None: ...
|
||||
def __init__(self, digest_method: Optional[Callable] = ...) -> None: ...
|
||||
def get_signature(self, key: bytes_like, value: bytes_like) -> str: ...
|
||||
|
||||
class Signer:
|
||||
@@ -70,10 +70,10 @@ class Signer:
|
||||
key_derivation = ... # type: str
|
||||
digest_method = ... # type: Callable
|
||||
algorithm = ... # type: SigningAlgorithm
|
||||
def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like]=None, sep: Optional[str]='',
|
||||
key_derivation: Optional[str]=None,
|
||||
digest_method: Optional[Callable]=None,
|
||||
algorithm: Optional[SigningAlgorithm]=None) -> None: ...
|
||||
def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., sep: Optional[str]='',
|
||||
key_derivation: Optional[str] = ...,
|
||||
digest_method: Optional[Callable] = ...,
|
||||
algorithm: Optional[SigningAlgorithm] = ...) -> None: ...
|
||||
def derive_key(self) -> str: ...
|
||||
def get_signature(self, value: bytes_like) -> str: ...
|
||||
def sign(self, value: bytes_like) -> str: ...
|
||||
@@ -85,8 +85,8 @@ class TimestampSigner(Signer):
|
||||
def get_timestamp(self) -> int: ...
|
||||
def timestamp_to_datetime(self, ts: int) -> datetime: ...
|
||||
def sign(self, value: bytes_like) -> str: ...
|
||||
def unsign(self, value: str, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def validate(self, signed_value: str, max_age: Optional[int]=None) -> bool: ...
|
||||
def unsign(self, value: str, max_age: Optional[int] = ..., return_timestamp=False) -> Any: ...
|
||||
def validate(self, signed_value: str, max_age: Optional[int] = ...) -> bool: ...
|
||||
|
||||
class Serializer:
|
||||
default_serializer = ... # type: Any
|
||||
@@ -97,21 +97,21 @@ class Serializer:
|
||||
is_text_serializer = ... # type: bool
|
||||
signer = ... # type: Signer
|
||||
signer_kwargs = ... # type: MutableMapping
|
||||
def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like]=b'', serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None) -> None: ...
|
||||
def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like]=b'', serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ...
|
||||
def load_payload(self, payload: Any, serializer=None) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> str: ...
|
||||
def make_signer(self, salt: Optional[bytes_like]=None) -> Signer: ...
|
||||
def dumps(self, obj: Any, salt: Optional[bytes_like]=None) -> str: ...
|
||||
def dump(self, obj: Any, f: IO[str], salt: Optional[bytes_like]=None) -> None: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like]=None) -> Any: ...
|
||||
def load(self, f: IO[str], salt: Optional[bytes_like]=None): ...
|
||||
def loads_unsafe(self, s, salt: Optional[bytes_like]=None) -> Tuple[bool, Any]: ...
|
||||
def make_signer(self, salt: Optional[bytes_like] = ...) -> Signer: ...
|
||||
def dumps(self, obj: Any, salt: Optional[bytes_like] = ...) -> str: ...
|
||||
def dump(self, obj: Any, f: IO[str], salt: Optional[bytes_like] = ...) -> None: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like] = ...) -> Any: ...
|
||||
def load(self, f: IO[str], salt: Optional[bytes_like] = ...): ...
|
||||
def loads_unsafe(self, s, salt: Optional[bytes_like] = ...) -> Tuple[bool, Any]: ...
|
||||
def load_unsafe(self, f: IO[str], *args, **kwargs) -> Tuple[bool, Any]: ...
|
||||
|
||||
class TimedSerializer(Serializer):
|
||||
default_signer = ... # type: Callable[..., TimestampSigner]
|
||||
def loads(self, s: str, salt: Optional[bytes_like]=None, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def loads_unsafe(self, s: str, salt: Optional[bytes_like]=None, max_age: Optional[int]=None) -> Tuple[bool, Any]: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like] = ..., max_age: Optional[int] = ..., return_timestamp=False) -> Any: ...
|
||||
def loads_unsafe(self, s: str, salt: Optional[bytes_like] = ..., max_age: Optional[int] = ...) -> Tuple[bool, Any]: ...
|
||||
|
||||
class JSONWebSignatureSerializer(Serializer):
|
||||
jws_algorithms = ... # type: MutableMapping[str, SigningAlgorithm]
|
||||
@@ -119,22 +119,22 @@ class JSONWebSignatureSerializer(Serializer):
|
||||
default_serializer = ... # type: Any
|
||||
algorithm_name = ... # type: str
|
||||
algorithm = ... # type: Any
|
||||
def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like]=None, serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None, algorithm_name: Optional[str]=None) -> None: ...
|
||||
def __init__(self, secret_key: bytes_like, salt: Optional[bytes_like] = ..., serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ...
|
||||
def load_payload(self, payload: Any, return_header=False) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> str: ...
|
||||
def make_algorithm(self, algorithm_name: str) -> SigningAlgorithm: ...
|
||||
def make_signer(self, salt: Optional[bytes_like]=None, algorithm_name: Optional[str]=None) -> Signer: ...
|
||||
def make_signer(self, salt: Optional[bytes_like] = ..., algorithm_name: Optional[str] = ...) -> Signer: ...
|
||||
def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ...
|
||||
def dumps(self, obj: Any, salt: Optional[bytes_like]=None, header_fields=Optional[MutableMapping]) -> str: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like]=None, return_header=False) -> Any: ...
|
||||
def loads_unsafe(self, s, salt: Optional[bytes_like]=None, return_header=False) -> Tuple[bool, Any]: ...
|
||||
def dumps(self, obj: Any, salt: Optional[bytes_like] = ..., header_fields=Optional[MutableMapping]) -> str: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like] = ..., return_header=False) -> Any: ...
|
||||
def loads_unsafe(self, s, salt: Optional[bytes_like] = ..., return_header=False) -> Tuple[bool, Any]: ...
|
||||
|
||||
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
|
||||
DEFAULT_EXPIRES_IN = ... # type: int
|
||||
expires_in = ... # type: int
|
||||
def __init__(self, secret_key: bytes_like, expires_in: Optional[int]=None, **kwargs) -> None: ...
|
||||
def __init__(self, secret_key: bytes_like, expires_in: Optional[int] = ..., **kwargs) -> None: ...
|
||||
def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like]=None, return_header=False) -> Any: ...
|
||||
def loads(self, s: str, salt: Optional[bytes_like] = ..., return_header=False) -> Any: ...
|
||||
def get_issue_date(self, header: MutableMapping) -> Optional[datetime]: ...
|
||||
def now(self) -> int: ...
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class WebDriver:
|
||||
desired_capabilities: Capabilities=None,
|
||||
browser_profile=None,
|
||||
proxy=None,
|
||||
keep_alive: bool=False
|
||||
keep_alive: bool = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def mobile(self) -> Mobile: ...
|
||||
@@ -29,7 +29,7 @@ class WebDriver:
|
||||
w3c = ... # type: Any
|
||||
def start_session(self, desired_capabilities, browser_profile=None): ...
|
||||
def create_web_element(self, element_id: basestring) -> WebElement: ...
|
||||
def execute(self, driver_command: basestring, params: Optional[Dict[basestring, Any]]=None) -> ExecuteResult: ...
|
||||
def execute(self, driver_command: basestring, params: Optional[Dict[basestring, Any]] = ...) -> ExecuteResult: ...
|
||||
def get(self, url: basestring) -> None: ...
|
||||
@property
|
||||
def title(self) -> basestring: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ SizeDict = Dict[str, int] # containing "height", "width"
|
||||
PointDict = Dict[str, int] # containing "x", "y"
|
||||
|
||||
class WebElement:
|
||||
def __init__(self, parent: WebDriver, id_: Optional[basestring], w3c: bool=False) -> None: ...
|
||||
def __init__(self, parent: WebDriver, id_: Optional[basestring], w3c: bool = ...) -> None: ...
|
||||
@property
|
||||
def tag_name(self) -> basestring: ...
|
||||
@property
|
||||
|
||||
4
third_party/2/werkzeug/wrappers.pyi
vendored
4
third_party/2/werkzeug/wrappers.pyi
vendored
@@ -20,7 +20,7 @@ class BaseRequest:
|
||||
disable_data_descriptor = ... # type: Any
|
||||
environ = ... # type: Mapping[str, object]
|
||||
shallow = ... # type: Any
|
||||
def __init__(self, environ: Mapping[basestring, object], populate_request: bool=True, shallow: bool=False) -> None: ...
|
||||
def __init__(self, environ: Mapping[basestring, object], populate_request: bool = ..., shallow: bool = ...) -> None: ...
|
||||
@property
|
||||
def url_charset(self) -> str: ...
|
||||
@classmethod
|
||||
@@ -37,7 +37,7 @@ class BaseRequest:
|
||||
input_stream = ... # type: Any
|
||||
args = ... # type: ImmutableMultiDict
|
||||
def data(self): ...
|
||||
def get_data(self, cache: bool=True, as_text: bool=False, parse_form_data: bool=False) -> str: ...
|
||||
def get_data(self, cache: bool = ..., as_text: bool = ..., parse_form_data: bool = ...) -> str: ...
|
||||
form = ... # type: ImmutableMultiDict
|
||||
values = ... # type: CombinedMultiDict
|
||||
files = ... # type: MultiDict
|
||||
|
||||
2
third_party/2and3/atomicwrites/__init__.pyi
vendored
2
third_party/2and3/atomicwrites/__init__.pyi
vendored
@@ -6,7 +6,7 @@ from typing import Any, AnyStr, Callable, ContextManager, IO, Iterator, Optional
|
||||
def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
|
||||
def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...
|
||||
class AtomicWriter(object):
|
||||
def __init__(self, path: AnyStr, mode: Text='w', overwrite: bool=False) -> None: ...
|
||||
def __init__(self, path: AnyStr, mode: Text='w', overwrite: bool = ...) -> None: ...
|
||||
def open(self) -> ContextManager[IO]: ...
|
||||
def _open(self, get_fileobject: Callable) -> ContextManager[IO]: ...
|
||||
def get_fileobject(self, dir: Optional[AnyStr] = ..., **kwargs) -> IO: ...
|
||||
|
||||
2
third_party/2and3/click/core.pyi
vendored
2
third_party/2and3/click/core.pyi
vendored
@@ -121,7 +121,7 @@ class Context:
|
||||
def abort(self) -> None:
|
||||
...
|
||||
|
||||
def exit(self, code: Union[int, str] = 0) -> None:
|
||||
def exit(self, code: Union[int, str] = ...) -> None:
|
||||
...
|
||||
|
||||
def get_usage(self) -> str:
|
||||
|
||||
2
third_party/2and3/click/termui.pyi
vendored
2
third_party/2and3/click/termui.pyi
vendored
@@ -107,7 +107,7 @@ def unstyle(text: str) -> str:
|
||||
def secho(
|
||||
text: str,
|
||||
file: Optional[IO] = ...,
|
||||
nl: bool =True,
|
||||
nl: bool = ...,
|
||||
err: bool = ...,
|
||||
color: Optional[bool] = ...,
|
||||
fg: Optional[str] = ...,
|
||||
|
||||
2
third_party/2and3/pymysql/connections.pyi
vendored
2
third_party/2and3/pymysql/connections.pyi
vendored
@@ -96,7 +96,7 @@ class Connection:
|
||||
def rollback(self): ...
|
||||
def escape(self, obj): ...
|
||||
def literal(self, obj): ...
|
||||
def cursor(self, cursor: Optional[Type[Cursor]]=None): ...
|
||||
def cursor(self, cursor: Optional[Type[Cursor]] = ...): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc, value, traceback): ...
|
||||
def query(self, sql): ...
|
||||
|
||||
8
third_party/2and3/requests/adapters.pyi
vendored
8
third_party/2and3/requests/adapters.pyi
vendored
@@ -44,10 +44,10 @@ DEFAULT_RETRIES = ... # type: Any
|
||||
|
||||
class BaseAdapter:
|
||||
def __init__(self) -> None: ...
|
||||
def send(self, request: PreparedRequest, stream: bool=False,
|
||||
timeout: Union[None, float, Tuple[float, float]]=None,
|
||||
verify: bool=False,
|
||||
cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]]=None
|
||||
def send(self, request: PreparedRequest, stream: bool = ...,
|
||||
timeout: Union[None, float, Tuple[float, float]] = ...,
|
||||
verify: bool = ...,
|
||||
cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ...
|
||||
) -> Response: ...
|
||||
def close(self) -> None: ...
|
||||
class HTTPAdapter(BaseAdapter):
|
||||
|
||||
54
third_party/3/itsdangerous.pyi
vendored
54
third_party/3/itsdangerous.pyi
vendored
@@ -30,15 +30,15 @@ class BadData(Exception):
|
||||
|
||||
class BadPayload(BadData):
|
||||
original_error = ... # type: Optional[Exception]
|
||||
def __init__(self, message: str, original_error: Optional[Exception]=None) -> None: ...
|
||||
def __init__(self, message: str, original_error: Optional[Exception] = ...) -> None: ...
|
||||
|
||||
class BadSignature(BadData):
|
||||
payload = ... # type: Optional[Any]
|
||||
def __init__(self, message: str, payload: Optional[Any]=None) -> None: ...
|
||||
def __init__(self, message: str, payload: Optional[Any] = ...) -> None: ...
|
||||
|
||||
class BadTimeSignature(BadSignature):
|
||||
date_signed = ... # type: Optional[int]
|
||||
def __init__(self, message: str, payload: Optional[Any]=None, date_signed: Optional[int]=None) -> None: ...
|
||||
def __init__(self, message: str, payload: Optional[Any] = ..., date_signed: Optional[int] = ...) -> None: ...
|
||||
|
||||
class BadHeader(BadSignature):
|
||||
header = ... # type: Any
|
||||
@@ -62,7 +62,7 @@ class NoneAlgorithm(SigningAlgorithm):
|
||||
class HMACAlgorithm(SigningAlgorithm):
|
||||
default_digest_method = ... # type: Callable
|
||||
digest_method = ... # type: Callable
|
||||
def __init__(self, digest_method: Optional[Callable]=None) -> None: ...
|
||||
def __init__(self, digest_method: Optional[Callable] = ...) -> None: ...
|
||||
def get_signature(self, key: _bytes_like, value: _bytes_like) -> bytes: ...
|
||||
|
||||
class Signer:
|
||||
@@ -74,10 +74,10 @@ class Signer:
|
||||
key_derivation = ... # type: str
|
||||
digest_method = ... # type: Callable
|
||||
algorithm = ... # type: SigningAlgorithm
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=None, sep: Optional[_can_become_bytes]='',
|
||||
key_derivation: Optional[str]=None,
|
||||
digest_method: Optional[Callable]=None,
|
||||
algorithm: Optional[SigningAlgorithm]=None) -> None: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., sep: Optional[_can_become_bytes]='',
|
||||
key_derivation: Optional[str] = ...,
|
||||
digest_method: Optional[Callable] = ...,
|
||||
algorithm: Optional[SigningAlgorithm] = ...) -> None: ...
|
||||
def derive_key(self) -> bytes: ...
|
||||
def get_signature(self, value: _bytes_like) -> bytes: ...
|
||||
def sign(self, value: _bytes_like) -> bytes: ...
|
||||
@@ -89,8 +89,8 @@ 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: bool=False) -> Any: ...
|
||||
def validate(self, signed_value: _can_become_bytes, max_age: Optional[int]=None) -> bool: ...
|
||||
def unsign(self, value: _can_become_bytes, max_age: Optional[int] = ..., return_timestamp: bool = ...) -> Any: ...
|
||||
def validate(self, signed_value: _can_become_bytes, max_age: Optional[int] = ...) -> bool: ...
|
||||
|
||||
class Serializer:
|
||||
default_serializer = ... # type: _serializer
|
||||
@@ -101,21 +101,21 @@ class 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: _serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None) -> None: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=b'', serializer: _serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> 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: ...
|
||||
def dump(self, obj: Any, f: IO, salt: Optional[_can_become_bytes]=None) -> None: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None) -> Any: ...
|
||||
def load(self, f: IO, salt: Optional[_can_become_bytes]=None): ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None) -> Tuple[bool, Any]: ...
|
||||
def make_signer(self, salt: Optional[_can_become_bytes] = ...) -> Signer: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes] = ...) -> _str_like: ...
|
||||
def dump(self, obj: Any, f: IO, salt: Optional[_can_become_bytes] = ...) -> None: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ...) -> Any: ...
|
||||
def load(self, f: IO, salt: Optional[_can_become_bytes] = ...): ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ...) -> Tuple[bool, Any]: ...
|
||||
def load_unsafe(self, f: IO, *args, **kwargs) -> Tuple[bool, Any]: ...
|
||||
|
||||
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: 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]: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., max_age: Optional[int] = ..., return_timestamp: bool = ...) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., max_age: Optional[int] = ...) -> Tuple[bool, Any]: ...
|
||||
|
||||
class JSONWebSignatureSerializer(Serializer):
|
||||
jws_algorithms = ... # type: MutableMapping[str, SigningAlgorithm]
|
||||
@@ -123,22 +123,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: _serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None, algorithm_name: Optional[str]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, serializer: _serializer = None, return_header: bool=False) -> Any: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., serializer: _serializer=None, signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ...
|
||||
def load_payload(self, payload: Any, serializer: _serializer = None, return_header: bool = ...) -> 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_signer(self, salt: Optional[_can_become_bytes] = ..., algorithm_name: Optional[str] = ...) -> 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: bool=False) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header: bool=False) -> Tuple[bool, Any]: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes] = ..., header_fields: Optional[MutableMapping]=...) -> str: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., return_header: bool = ...) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., return_header: bool = ...) -> 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 __init__(self, secret_key: _can_become_bytes, expires_in: Optional[int] = ..., **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: bool=False) -> Any: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., return_header: bool = ...) -> Any: ...
|
||||
def get_issue_date(self, header: MutableMapping) -> Optional[datetime]: ...
|
||||
def now(self) -> int: ...
|
||||
|
||||
|
||||
10
third_party/3/werkzeug/wrappers.pyi
vendored
10
third_party/3/werkzeug/wrappers.pyi
vendored
@@ -20,7 +20,7 @@ class BaseRequest:
|
||||
disable_data_descriptor = ... # type: Any
|
||||
environ = ... # type: Mapping[str, object]
|
||||
shallow = ... # type: Any
|
||||
def __init__(self, environ: Mapping[str, object], populate_request: bool=True, shallow: bool=False) -> None: ...
|
||||
def __init__(self, environ: Mapping[str, object], populate_request: bool = ..., shallow: bool = ...) -> None: ...
|
||||
@property
|
||||
def url_charset(self) -> str: ...
|
||||
@classmethod
|
||||
@@ -37,7 +37,7 @@ class BaseRequest:
|
||||
input_stream = ... # type: Any
|
||||
args = ... # type: ImmutableMultiDict
|
||||
def data(self): ...
|
||||
def get_data(self, cache: bool=True, as_text: bool=False, parse_form_data: bool=False) -> bytes: ...
|
||||
def get_data(self, cache: bool = ..., as_text: bool = ..., parse_form_data: bool = ...) -> bytes: ...
|
||||
form = ... # type: ImmutableMultiDict
|
||||
values = ... # type: CombinedMultiDict
|
||||
files = ... # type: MultiDict
|
||||
@@ -76,14 +76,14 @@ class BaseResponse:
|
||||
status = ... # type: str
|
||||
direct_passthrough = ... # type: bool
|
||||
response = ... # type: Iterable[bytes]
|
||||
def __init__(self, response: Optional[Union[Iterable[bytes], bytes]]=None,
|
||||
status: Optional[Union[str, int]]=None,
|
||||
def __init__(self, response: Optional[Union[Iterable[bytes], bytes]] = ...,
|
||||
status: Optional[Union[str, int]] = ...,
|
||||
headers: Optional[Union[Headers,
|
||||
Mapping[str, str],
|
||||
Sequence[Tuple[str, str]]]]=None,
|
||||
mimetype: Optional[str] = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
direct_passthrough: bool=False) -> None: ...
|
||||
direct_passthrough: bool = ...) -> None: ...
|
||||
def call_on_close(self, func): ...
|
||||
@classmethod
|
||||
def force_type(cls, response, environ=None): ...
|
||||
|
||||
Reference in New Issue
Block a user