def visit_listcomp(self, node, parent): """visit a ListComp node by returning a fresh instance of it""" newnode = new.ListComp() self._set_infos(node, newnode, parent) newnode.elt = self.visit(node.expr, newnode) newnode.generators = [self.visit(child, newnode) for child in node.quals] return newnode
def visit_listcomp(self, node, parent): """visit a ListComp node by returning a fresh instance of it""" newnode = new.ListComp() _lineno_parent(node, newnode, parent) newnode.elt = self.visit(node.elt, newnode) newnode.generators = [self.visit(child, newnode) for child in node.generators] newnode.set_line_info(newnode.last_child()) return newnode