From 42b0089a4c768992d291ecab45c0a8ff4ef3c094 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 7 Oct 2015 22:03:24 +0300 Subject: [PATCH] transforms.asttyped_rewriter: simplify. --- artiq/compiler/transforms/asttyped_rewriter.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/artiq/compiler/transforms/asttyped_rewriter.py b/artiq/compiler/transforms/asttyped_rewriter.py index ee93e0834..20aecdb62 100644 --- a/artiq/compiler/transforms/asttyped_rewriter.py +++ b/artiq/compiler/transforms/asttyped_rewriter.py @@ -38,8 +38,7 @@ class LocalExtractor(algorithm.Visitor): def visit_Assign(self, node): self.visit(node.value) - for target in node.targets: - self.visit_in_assign(target, in_assign=True) + self.visit_in_assign(node.targets, in_assign=True) def visit_For(self, node): self.visit(node.iter) @@ -49,14 +48,12 @@ class LocalExtractor(algorithm.Visitor): def visit_withitem(self, node): self.visit(node.context_expr) - if node.optional_vars is not None: - self.visit_in_assign(node.optional_vars, in_assign=True) + self.visit_in_assign(node.optional_vars, in_assign=True) def visit_comprehension(self, node): self.visit(node.iter) self.visit_in_assign(node.target, in_assign=True) - for if_ in node.ifs: - self.visit(node.ifs) + self.visit(node.ifs) def visit_generator(self, node): if self.in_root: