astx.context_manager

astx.context_manager

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

title: ASTx class for With Statement (Context Manager).

Classes

WithItem

title: AST class representing an item inside a `with` statement.
attributes:
  context_expr:
    type: Expr
  instance_name:
    type: Optional[Identifier]

Methods

get_struct(self, simplified: bool=False) -> dict[str, DataTypesStruct]
title: Get structural representation of the WithItem.
parameters:
  simplified:
    type: bool
returns:
  type: dict[str, DataTypesStruct]

WithStmt(StatementType)

title: AST class for the `with` statement (context manager).
attributes:
  items:
    type: list[WithItem]
  body:
    type: Block
  kind:
    type: ASTKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Get structural representation of the WithStmt.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct