Skip to content

Commit

Permalink
mysql: Ignore new MyPy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mhthies committed Dec 23, 2023
1 parent 8b736fd commit 54175a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shc/interfaces/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ def _get_to_mysql_converter(type_: Type[T]) -> Callable[[T], Any]:
@staticmethod
def _get_from_mysql_converter(type_: Type[T]) -> Callable[[Any], T]:
if type_ is bool:
return lambda x: bool(x)
elif type_ in (bool, int, float, str):
return lambda x: bool(x) # type: ignore # type_ is equivalent to T -> type_ is bool here
elif type_ in (int, float, str):
return lambda x: x
elif issubclass(type_, (bool, int, float, str, enum.Enum)):
return lambda value: type_(value) # type: ignore # type_ is equivalent to T -> type_() is an instance of T
Expand Down

0 comments on commit 54175a7

Please sign in to comment.