context
¶
Provide a small facade node for Python-like with statements until
upstream ASTx exposes a canonical context-manager construct.
Classes:
-
WithStmt–
WithStmt
¶
WithStmt(
manager: AST,
body: Block,
target: AST | None = None,
loc: SourceLocation = NO_SOURCE_LOCATION,
parent: ASTNodes | None = None,
)
Bases: StatementType
Model source forms equivalent to with manager as target: body while
keeping the manager expression, optional target, and body as regular ASTx
child nodes.
attributes:
manager:
type: astx.AST
body:
type: astx.Block
target:
type: astx.AST | None
Methods:
Source code in src/irx/astx/context.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Source code in src/irx/astx/context.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |