From bc508f8982cea15d7ee888643b66167f2432f2f1 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Fri, 28 Oct 2022 02:18:39 +0100 Subject: [PATCH] use walrus =) --- examples/dsl/__main__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/dsl/__main__.py b/examples/dsl/__main__.py index 8ba15cf..af91ac5 100644 --- a/examples/dsl/__main__.py +++ b/examples/dsl/__main__.py @@ -64,8 +64,7 @@ def interactive_mode(parser): while cmd := input("Please enter command (Press to exit)\n"): if not cmd: break - res = parser.parse((cmd,)) - if res: + if res := parser.parse((cmd,)): print(res) @@ -91,8 +90,7 @@ def main(): interactive_mode(parser) return - res = parser.parse(cmds) - if res: + if res := parser.parse(cmds): print(res)