diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 5c35014b246b64..303c201f1a6feb 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -611,8 +611,8 @@ The match statement is used for pattern matching. Syntax: .. productionlist:: python-grammar match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT - subject_expr: `!star_named_expression` "," `!star_named_expressions`? - : | `!named_expression` + subject_expr: `flexible_expression` "," [`flexible_expression_list` [',']] + : | `assignment_expression` case_block: 'case' `patterns` [`guard`] ":" `!block` .. note:: @@ -702,7 +702,7 @@ Guards .. index:: ! guard .. productionlist:: python-grammar - guard: "if" `!named_expression` + guard: "if" `assignment_expression` A ``guard`` (which is part of the ``case``) must succeed for code inside the ``case`` block to execute. It takes the form: :keyword:`if` followed by an