PyDocs

Nav

Python Language Services

MatchValue

ast

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