Exemplo n.º 1
0
 def visit_unaryop(self, node, parent):
     """visit an UnaryOp node by returning a fresh instance of it"""
     newnode = new.UnaryOp()
     self._set_infos(node, newnode, parent)
     newnode.operand = self.visit(node.expr, newnode)
     newnode.op = UnaryOp_OP_CLASSES[node.__class__]
     return newnode
Exemplo n.º 2
0
 def visit_unaryop(self, node, parent):
     """visit a UnaryOp node by returning a fresh instance of it"""
     newnode = new.UnaryOp()
     _lineno_parent(node, newnode, parent)
     newnode.operand = self.visit(node.operand, newnode)
     newnode.op = _UNARY_OP_CLASSES[node.op.__class__]
     newnode.set_line_info(newnode.last_child())
     return newnode