TryStar¶
- class astroid.nodes.TryStar(*, lineno: int | None = None, col_offset: int | None = None, end_lineno: int | None = None, end_col_offset: int | None = None, parent: NodeNG | None = None)[source]¶
Bases:
MultiLineWithElseBlockNode
,Statement
Class representing an
ast.TryStar
node.- block_range(lineno: int) tuple[int, int] [source]¶
Get a range from a given line number to where this node ends.
- handlers: list[ExceptHandler]¶
The exception handlers.
- postinit(*, body: list[NodeNG] | None = None, handlers: list[ExceptHandler] | None = None, orelse: list[NodeNG] | None = None, finalbody: list[NodeNG] | None = None) None [source]¶
Do some setup after initialisation. :param body: The contents of the block to catch exceptions from. :param handlers: The exception handlers. :param orelse: The contents of the
else
block. :param finalbody: The contents of thefinally
block.