Use lowercase tuple where possible (#6170)

This commit is contained in:
Akuli
2021-10-15 00:18:19 +00:00
committed by GitHub
parent 5f386b0575
commit 994b69ef8f
242 changed files with 1212 additions and 1224 deletions
+5 -5
View File
@@ -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 = ...