MatchMapping

class astroid.nodes.MatchMapping(lineno: int | None = None, col_offset: int | None = None, parent: NodeNG | None = None, *, end_lineno: int | None = None, end_col_offset: int | None = None)[source]

Bases: AssignTypeNode, Pattern

Class representing a ast.MatchMapping node.

>>> import astroid
>>> node = astroid.extract_node('''
match x:
    case {1: "Hello", 2: "World", 3: _, **rest}:
        ...
''')
>>> node.cases[0].pattern
<MatchMapping l.3 at 0x10c8a8850>
assigned_stmts(**kwargs: _P.kwargs) Generator[InferenceResult]

Returns the assigned statement (non inferred) according to the assignment type. See astroid/protocols.py for actual implementation.

postinit(*, keys: list[NodeNG], patterns: list[Pattern], rest: AssignName | None) None[source]