API reference
python:astx:astx.context_manager.WithStmt
class WithStmt
WithStmt(items: list[WithItem], body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/context_manager.py:89
AST class for the with statement (context manager).
Attributes
-
items — Items to process.; Type: list[WithItem]
-
body — Statements forming the body.; Type: Block
-
kind — Kind of value or operation.; Type: ASTKind
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__init__ — Initialize WithStmt instance.
-
__str__ — Return string representation of the WithStmt.
-
get_struct — Get structural representation of the WithStmt.