Improve itsdangerous stubs (#1733)

This commit is contained in:
Jelle Zijlstra
2018-01-03 04:50:22 +08:00
committed by Matthias Kramm
parent bb8b9bdaec
commit fb2c7b34e2
2 changed files with 33 additions and 32 deletions

View File

@@ -20,7 +20,7 @@ class _CompactJSON:
compact_json = _CompactJSON
EPOCH = ... # type: int
def want_bytes(s: _can_become_bytes, encoding: str='', errors: str='') -> bytes: ...
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: ...
@@ -74,7 +74,7 @@ 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] = ..., sep: Optional[_can_become_bytes]='',
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: ...
@@ -101,8 +101,8 @@ 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]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ...
def load_payload(self, payload: Any, serializer: _serializer=None) -> Any: ...
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ...) -> None: ...
def load_payload(self, payload: Any, serializer: Optional[_serializer] = ...) -> Any: ...
def dump_payload(self, *args, **kwargs) -> bytes: ...
def make_signer(self, salt: Optional[_can_become_bytes] = ...) -> Signer: ...
def dumps(self, obj: Any, salt: Optional[_can_become_bytes] = ...) -> _str_like: ...
@@ -123,8 +123,8 @@ 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] = ..., 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 __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes] = ..., serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., signer_kwargs: Optional[MutableMapping] = ..., algorithm_name: Optional[str] = ...) -> None: ...
def load_payload(self, payload: Any, serializer: Optional[_serializer] = ..., 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] = ..., algorithm_name: Optional[str] = ...) -> Signer: ...