From 88c74ce9abe4c14310a868a0410f61c83b316dd0 Mon Sep 17 00:00:00 2001 From: Gabriel lima Date: Sat, 28 Sep 2024 13:26:32 -0300 Subject: [PATCH] Simplify type checking in sort_collections() Closes https://github.com/StackGuardian/tirith/issues/185 --- src/tirith/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tirith/utils.py b/src/tirith/utils.py index de83bf1..6c3eb83 100644 --- a/src/tirith/utils.py +++ b/src/tirith/utils.py @@ -5,7 +5,7 @@ def sort_collections(inputs): try: - if isinstance(inputs, str) or isinstance(inputs, float) or isinstance(inputs, int) or isinstance(inputs, bool): + if isinstance(inputs, (str, float, int, bool)): return inputs elif isinstance(inputs, list): if len(inputs) == 0: