astx.operators

astx.operators

Source: packages/astx/src/astx/operators.py

title: ASTx classes for the operators.

Classes

WalrusOp(DataType)

title: AST class for the Walrus (assignment expression) operator.
attributes:
  lhs:
    type: Variable
  rhs:
    type: DataType
  kind:
    type: ASTKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure that represents the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

AssignmentExpr(Expr)

title: AST class for assignment expressions.
attributes:
  kind:
    type: ASTKind
  targets:
    type: ASTNodes[Expr]
  value:
    type: Expr

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

VariableAssignment(StatementType)

title: AST class for variable declaration.
attributes:
  loc:
    type: SourceLocation
  kind:
    type: ASTKind
  name:
    type: str
  value:
    type: Expr

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

AugAssign(DataType)

title: AST class for augmented assignment.
attributes:
  kind:
    type: ASTKind
  target:
    type: Identifier
  op_code:
    type: OpCodeAugAssign
  value:
    type: DataType

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

CompareOp(DataType)

title: AST class for comparison operators acting as properties.
attributes:
  ops:
    type: list[Literal[==, !=, <, >, <=, >=]]
  comparators:
    type: list[DataType]
  left:
    type: DataType
  kind:
    type: ASTKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure that represents the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

Starred(Expr)

title: AST class for starred expressions (*expr).
attributes:
  kind:
    type: ASTKind
  value:
    type: Expr

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure that represents the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct