astx.system

astx.system

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

title: ASTx system AST nodes.

Classes

AssertStmt(astx.StatementType)

title: AssertStmt AST class.
summary: >-
  Represent one fatal assertion statement with an optional failure message.
attributes:
  condition:
    type: astx.Expr
  message:
    type: astx.Expr | None
  loc:
    type: astx.SourceLocation

Methods

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

PrintExpr(astx.Expr)

title: PrintExpr AST class.
attributes:
  message:
    type: astx.Expr
  _name:
    type: str
notes: >-
  It would be nice to support more arguments similar to the ones supported
  by Python (*args, sep=' ', end='', file=None, flush=False).

Methods

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

Cast(astx.DataType)

title: Cast AST node for type conversions.
summary: Represents a cast of `value` to a specified `target_type`.
attributes:
  value:
    type: astx.DataType
  target_type:
    type: Any

Methods

get_struct(self, simplified: bool=False) -> astx.base.ReprStruct
title: Return the structured representation of the cast expression.
parameters:
  simplified:
    type: bool
returns:
  type: astx.base.ReprStruct

IsInstanceExpr(astx.Expr)

title: IsInstanceExpr AST class.
summary: Represent a type-membership check against one target type.
attributes:
  value:
    type: astx.Expr
  target_type:
    type: astx.DataType

Methods

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

TypeOfExpr(astx.Expr)

title: TypeOfExpr AST class.
summary: Represent an expression that produces a value's type name.
attributes:
  value:
    type: astx.Expr

Methods

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