PyDocs

Nav

Python Language Services

MatchSingleton

ast

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