PyDocs

Nav

Python Language Services

MatchSequence

ast

class · Added in 3.10
  • MatchSequence(patterns)
MatchSequence(pattern* patterns)
1 Example
>>> print(ast.dump(ast.parse("""
... match x:
...     case [1, 2]:
...         ...
... """), indent=4))
Module(
    body=[
        Match(
            subject=Name(id='x'),
            cases=[
                match_case(
                    pattern=MatchSequence(
                        patterns=[
                            MatchValue(
                                value=Constant(value=1)),
                            MatchValue(
                                value=Constant(value=2))]),
                    body=[
                        Expr(
                            value=Constant(value=Ellipsis))])])])
from the Python docs
See Also
No see-alsos for ast/MatchSequence
0 Notes
No notes for MatchSequence