mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-02 06:00:24 +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
Vendored
+27
-27
@@ -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: ...
|
||||
|
||||
|
||||
Vendored
+5
-5
@@ -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