astx.comprehensions

astx.comprehensions

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

title: AST comprehension classes and functions.

Classes

ComprehensionClause(Expr)

title: AST node for generic comprehensions.
attributes:
  kind:
    type: ASTKind
  target:
    type: Expr
  iterable:
    type: Expr
  conditions:
    type: ASTNodes[Expr]
  is_async:
    type: bool

Methods

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

Comprehension(Expr)

title: AST Comprehension class.
attributes:
  generators:
    type: ASTNodes[ComprehensionClause]

Methods

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

ListComprehension(Comprehension)

title: ListComprehension class.
attributes:
  generators:
    type: ASTNodes[ComprehensionClause]
  element:
    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

SetComprehension(Comprehension)

title: AST node representing set comprehension expressions.
attributes:
  generators:
    type: ASTNodes[ComprehensionClause]
  kind:
    type: ASTKind
  element:
    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

GeneratorExpr(Comprehension)

title: AST class for generator expressions.
attributes:
  generators:
    type: ASTNodes[ComprehensionClause]
  kind:
    type: ASTKind
  element:
    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