Skip to content

Commit

Permalink
fix:black
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Sep 21, 2024
1 parent 729ea36 commit b3979d0
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions fakeredis/_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class Int(RedisType):

DECODE_ERROR = msgs.INVALID_INT_MSG
ENCODE_ERROR = msgs.OVERFLOW_MSG
MIN_VALUE = -(2 ** 63)
MAX_VALUE = 2 ** 63 - 1
MIN_VALUE = -(2**63)
MAX_VALUE = 2**63 - 1

@classmethod
def valid(cls, value: int) -> bool:
Expand Down Expand Up @@ -201,13 +201,13 @@ class Float(RedisType):

@classmethod
def decode(
cls,
value: bytes,
allow_leading_whitespace: bool = False,
allow_erange: bool = False,
allow_empty: bool = False,
crop_null: bool = False,
decode_error: Optional[str] = None,
cls,
value: bytes,
allow_leading_whitespace: bool = False,
allow_erange: bool = False,
allow_empty: bool = False,
crop_null: bool = False,
decode_error: Optional[str] = None,
) -> float:
# Redis has some quirks in float parsing, with several variants.
# See https://github.com/antirez/redis/issues/5706
Expand Down Expand Up @@ -258,13 +258,13 @@ class SortFloat(Float):

@classmethod
def decode(
cls,
value: bytes,
allow_leading_whitespace: bool = True,
allow_erange: bool = False,
allow_empty: bool = True,
crop_null: bool = True,
decode_error: Optional[str] = None,
cls,
value: bytes,
allow_leading_whitespace: bool = True,
allow_erange: bool = False,
allow_empty: bool = True,
crop_null: bool = True,
decode_error: Optional[str] = None,
) -> float:
return super().decode(value, allow_leading_whitespace=True, allow_empty=True, crop_null=True)

Expand Down Expand Up @@ -366,13 +366,13 @@ def decode(cls, value: bytes) -> "StringTest":

class Signature:
def __init__(
self,
name: str,
func_name: str,
fixed: Tuple[Type[Union[RedisType, bytes]]],
repeat: Tuple[Type[Union[RedisType, bytes]]] = (), # type:ignore
args: Tuple[str] = (), # type:ignore
flags: str = "",
self,
name: str,
func_name: str,
fixed: Tuple[Type[Union[RedisType, bytes]]],
repeat: Tuple[Type[Union[RedisType, bytes]]] = (), # type:ignore
args: Tuple[str] = (), # type:ignore
flags: str = "",
):
self.name = name
self.func_name = func_name
Expand All @@ -393,7 +393,7 @@ def check_arity(self, args: Sequence[Any], version: Tuple[int]) -> None:
raise SimpleError(msg)

def apply(
self, args: Sequence[Any], db: Database, version: Tuple[int]
self, args: Sequence[Any], db: Database, version: Tuple[int]
) -> Union[Tuple[Any], Tuple[List[Any], List[CommandItem]]]:
"""Returns a tuple, which is either:
- transformed args and a dict of CommandItems; or
Expand Down Expand Up @@ -425,10 +425,10 @@ def apply(
if type_.type_ is not None and item is not None and type(item.value) is not type_.type_:
raise SimpleError(msgs.WRONGTYPE_MSG)
if (
msgs.FLAG_DO_NOT_CREATE not in self.flags
and type_.type_ is not None
and item is None
and type_.type_ is not bytes
msgs.FLAG_DO_NOT_CREATE not in self.flags
and type_.type_ is not None
and item is None
and type_.type_ is not bytes
):
default = type_.type_()
args_list[i] = CommandItem(arg, db, item, default=default)
Expand Down

0 comments on commit b3979d0

Please sign in to comment.