def visit_ifexp(self, node, parent): """visit an IfExp node by returning a fresh instance of it""" newnode = new.IfExp() self._set_infos(node, newnode, parent) newnode.test = self.visit(node.test, newnode) newnode.body = [self.visit(child, newnode) for child in node.body] newnode.orelse = self.visit(node.orelse, newnode) return newnode
def visit_ifexp(self, node, parent): """visit a IfExp node by returning a fresh instance of it""" newnode = new.IfExp() _lineno_parent(node, newnode, parent) newnode.test = self.visit(node.test, newnode) newnode.body = self.visit(node.body, newnode) newnode.orelse = self.visit(node.orelse, newnode) newnode.set_line_info(newnode.last_child()) return newnode