diff --git a/brian2/parsing/rendering.py b/brian2/parsing/rendering.py index 122311df5..6c93f11df 100644 --- a/brian2/parsing/rendering.py +++ b/brian2/parsing/rendering.py @@ -339,7 +339,12 @@ def render_BinOp(self, node): return NodeRenderer.render_BinOp(self, node) def render_Constant(self, node): - return {True: "true", False: "false"}.get(node.value, repr(node.value)) + if node.value is True: + return "true" + elif node.value is False: + return "false" + else: + return repr(node.value) def render_Name(self, node): if node.id == "inf":