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__] return newnode
def unaryop_node(draw, op=hs.one_of(non_bool_unary_op, unary_bool_operator), operand=const_node()): op = draw(op) operand = draw(operand) node = nodes.UnaryOp(op) node.postinit(operand) return node
def visit_unaryop(self, node, parent): """visit a UnaryOp node by returning a fresh instance of it""" newnode = nodes.UnaryOp( self._parser_module.unary_op_classes[node.op.__class__], node.lineno, node.col_offset, parent, ) newnode.postinit(self.visit(node.operand, newnode)) return newnode
def visit_unaryop(self, node, parent): """visit a UnaryOp node by returning a fresh instance of it""" newnode = nodes.UnaryOp(_UNARY_OP_CLASSES[node.op.__class__], node.lineno, node.col_offset, parent) newnode.postinit(self.visit(node.operand, newnode)) return newnode