API reference
python:astx:astx.UnaryOp
class UnaryOp
UnaryOp(op_code: str, operand: DataType, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/types/operators.py:240
Declared as: python:astx:astx.types.operators.UnaryOp
AST class for the unary operator.
Attributes
-
kind — Type: ASTKind
-
op_code — Type: str
-
operand — Type: DataType
Methods
-
__init__ — Initialize the UnaryOp instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure of the object.