diff --git a/libervia/backend/core/constants.py b/libervia/backend/core/constants.py index e75d476c..0e6ebfcd 100644 --- a/libervia/backend/core/constants.py +++ b/libervia/backend/core/constants.py @@ -35,6 +35,9 @@ else: logged_user = getuser() +bool_type = bool + + class Const(object): ## Application ## @@ -455,13 +458,13 @@ class Const(object): ) @classmethod - def bool(cls, value: str) -> bool: + def bool(cls, value: str) -> bool_type: """@return (bool): bool value for associated constant""" assert isinstance(value, str) return value.lower() in (cls.BOOL_TRUE, "1", "yes", "on", "y", "t") @classmethod - def bool_const(cls, value: bool) -> str: + def bool_const(cls, value: bool_type) -> str: """@return (str): constant associated to bool value""" assert isinstance(value, bool) return cls.BOOL_TRUE if value else cls.BOOL_FALSE