API reference
python:astx:astx.context_manager.WithItem
class WithItem
WithItem(context_expr: Expr, instance_name: Optional[Identifier] = None)
Source: packages/astx/src/astx/context_manager.py:25
AST class representing an item inside a with statement.
Attributes
-
context_expr — Type: Expr
-
instance_name — Type: Optional[Identifier]
Methods
-
__init__ — Initialize a WithItem instance.
-
__str__ — Return string representation of the WithItem.
-
_prepare_struct — Prepare structural representation.
-
get_struct — Get structural representation of the WithItem.