API reference
python:astx:astx.CompareOp
class CompareOp
CompareOp(left: DataType, ops: Iterable[Literal['==', '!=', '<', '>', '<=', '>=']], comparators: Iterable[DataType], loc: SourceLocation = NO_SOURCE_LOCATION)
Source: packages/astx/src/astx/operators.py:293
Declared as: python:astx:astx.operators.CompareOp
AST class for comparison operators acting as properties.
Attributes
-
ops — Ops.; Type: list[Literal['==', '!=', '<', '>', '<=', '>=']]
-
comparators — Comparators.; Type: list[DataType]
-
left — Left operand.; Type: DataType
-
kind — Kind of value or operation.; Type: ASTKind
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
type_ — Type: ExprType
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize the CompareOp instance.
-
__str__ — Return a string that represents the object.
-
get_struct — Return the AST structure that represents the object.