diff --git a/tiramisu/error.py b/tiramisu/error.py index dead711..55b50d2 100644 --- a/tiramisu/error.py +++ b/tiramisu/error.py @@ -39,8 +39,9 @@ TiramisuErrorCode = Literal[ def display_list( lst, *, - separator="and", - add_quote=False, + separator: str="and", + add_quote: bool=False, + sort: bool=True, ) -> str(): if not lst: return '""' @@ -61,15 +62,13 @@ def display_list( for l in lst: if not isinstance(l, str): l = str(l) - lst_.append(_(l)) - lst__ = [] - for l in lst_: if add_quote and not l.startswith('"'): l = '"{}"'.format(l) - lst__.append(l) - lst__.sort() - last = lst__[-1] - return ", ".join(lst__[:-1]) + _(" {} ").format(separator) + "{}".format(last) + lst_.append(_(l)) + if sort: + lst_.sort() + last = lst_[-1] + return ", ".join(lst_[:-1]) + _(" {} ").format(separator) + "{}".format(last) # Exceptions for an Option diff --git a/tiramisu/function.py b/tiramisu/function.py index ddcec38..8cbe94f 100644 --- a/tiramisu/function.py +++ b/tiramisu/function.py @@ -28,7 +28,7 @@ FUNCTION_WAITING_FOR_ERROR = [] def function_waiting_for_dict(function): """functions (calculation or validation) receive by default only the value of other options - all functions declared with this function recieve a dict with option informations + if you use this decoractor, it will recieve a dict with option informations (value, name, ...) """ name = function.__name__ @@ -38,8 +38,8 @@ def function_waiting_for_dict(function): def function_waiting_for_error(function): - """functions (calculation or validation) receive by default only the value of other options - set PropertyError too + """functions (calculation or validation) receiven by default, only the value of other options + if you use this decoractor, it will pass PropertyError too """ name = function.__name__ if name not in FUNCTION_WAITING_FOR_ERROR: