API reference

python:astx:astx.context.WithStmt

class WithStmt

WithStmt(manager: astx.AST, body: astx.Block, target: astx.AST | None = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: astx.ASTNodes | None = None)

Source: packages/astx/src/astx/context.py:18

Internal context-manager statement node.

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

Methods

Attributes

Search documentation

Type to search.