MatchCase#

class astroid.nodes.MatchCase(*, parent: NodeNG | None = None)[source]#

Bases: MultiLineBlockNode

Class representing a ast.match_case node.

>>> import astroid
>>> node = astroid.extract_node('''
match x:
    case 200:
        ...
''')
>>> node.cases[0]
<MatchCase l.3 at 0x10c24e590>
col_offset: None#

The column that this node appears on in the source code.

end_col_offset: None#

The end column this node appears on in the source code.

Note: This is after the last symbol.

end_lineno: None#

The last line this node appears on in the source code.

lineno: None#

The line that this node appears on in the source code.

postinit(*, pattern: Pattern, guard: NodeNG | None, body: list[NodeNG]) None[source]#