From d33068e263dfb62e47888ecd456cca0add6b3e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?WJ=20=C2=B7=20Zheng?= Date: Tue, 11 Nov 2025 14:42:32 +0800 Subject: [PATCH] Improve SomethingToString method in nodes.py Refactor stringify method to handle input types more clearly. --- nodes/nodes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nodes/nodes.py b/nodes/nodes.py index afc793f..6839f74 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -669,12 +669,13 @@ Converts any type to a string. """ def stringify(self, input, prefix="", suffix=""): + stringified = input if isinstance(input, (int, float, bool)): stringified = str(input) elif isinstance(input, list): stringified = ', '.join(str(item) for item in input) - else: - return + # else: + # return if prefix: # Check if prefix is not empty stringified = prefix + stringified # Add the prefix if suffix: # Check if suffix is not empty @@ -2622,4 +2623,4 @@ class LazySwitchKJ: def switch(self, switch, on_false = None, on_true=None): value = on_true if switch else on_false - return (value,) \ No newline at end of file + return (value,)