From 76440f4a8f46c2d9f3c25602116d965f4890be2b Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 7 Nov 2020 13:45:41 +0100 Subject: bool to string cast returned incorrect values. --- tonkadur.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tonkadur.py b/tonkadur.py index b20b1bd..afae903 100644 --- a/tonkadur.py +++ b/tonkadur.py @@ -84,7 +84,11 @@ class Tonkadur: content = self.compute(computation['content']) if (target_type == "string"): - return str(content) + if (origin_type == "bool"): + # Python would return True and False by default. + return "true" if content else "false" + else: + return str(content) elif (target_type == "float"): return float(content) elif (target_type == "bool"): -- cgit v1.2.3-70-g09d2