mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-24 09:18:40 +08:00
Use lowercase tuple where possible (#6170)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime
|
||||
from typing import IO, Any, Callable, Generator, Mapping, MutableMapping, Text, Tuple
|
||||
from typing import IO, Any, Callable, Generator, Mapping, MutableMapping, Text
|
||||
|
||||
_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module)
|
||||
|
||||
@@ -107,14 +107,14 @@ class Serializer(object):
|
||||
def dump(self, obj: Any, f: IO[Any], salt: Text | bytes | None = ...) -> None: ...
|
||||
def loads(self, s: Text | bytes, salt: Text | bytes | None = ...) -> Any: ...
|
||||
def load(self, f: IO[Any], salt: Text | bytes | None = ...) -> Any: ...
|
||||
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ...) -> Tuple[bool, Any | None]: ...
|
||||
def load_unsafe(self, f: IO[Any], salt: Text | bytes | None = ...) -> Tuple[bool, Any | None]: ...
|
||||
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ...) -> tuple[bool, Any | None]: ...
|
||||
def load_unsafe(self, f: IO[Any], salt: Text | bytes | None = ...) -> tuple[bool, Any | None]: ...
|
||||
|
||||
class TimedSerializer(Serializer):
|
||||
def loads(
|
||||
self, s: Text | bytes, salt: Text | bytes | None = ..., max_age: int | None = ..., return_timestamp: bool = ...
|
||||
) -> Any: ... # morally -> Any | Tuple[Any, datetime]
|
||||
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., max_age: int | None = ...) -> Tuple[bool, Any]: ...
|
||||
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., max_age: int | None = ...) -> tuple[bool, Any]: ...
|
||||
|
||||
class JSONWebSignatureSerializer(Serializer):
|
||||
jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ...
|
||||
@@ -143,7 +143,7 @@ class JSONWebSignatureSerializer(Serializer):
|
||||
def loads(
|
||||
self, s: Text | bytes, salt: Text | bytes | None = ..., return_header: bool = ...
|
||||
) -> Any: ... # morally -> Any | Tuple[Any, MutableMapping[str, Any]]
|
||||
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., return_header: bool = ...) -> Tuple[bool, Any]: ...
|
||||
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., return_header: bool = ...) -> tuple[bool, Any]: ...
|
||||
|
||||
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
|
||||
DEFAULT_EXPIRES_IN: int = ...
|
||||
|
||||
Reference in New Issue
Block a user