Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ The match statement is used for pattern matching. Syntax:
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
subject_expr: `flexible_expression` "," [`flexible_expression_list` [',']]
: | `assignment_expression`
case_block: 'case' `patterns` [`guard`] ":" `!block`
case_block: 'case' `patterns` [`guard`] ":" `suite`

.. note::
This section uses single quotes to denote
Expand Down Expand Up @@ -742,7 +742,7 @@ block is selected.

.. _irrefutable_case:

Irrefutable Case Blocks
Irrefutable case blocks
-----------------------

.. index:: irrefutable case block, case block
Expand Down Expand Up @@ -804,7 +804,7 @@ the underlying implementation. Furthermore, they do not cover all valid forms.

.. _or-patterns:

OR Patterns
OR patterns
^^^^^^^^^^^

An OR pattern is two or more patterns separated by vertical
Expand All @@ -825,7 +825,7 @@ match ``P2``, succeeding immediately if any succeeds, failing otherwise.

.. _as-patterns:

AS Patterns
AS patterns
^^^^^^^^^^^

An AS pattern matches an OR pattern on the left of the :keyword:`as`
Expand All @@ -844,7 +844,7 @@ set ``NAME = <subject>``.

.. _literal-patterns:

Literal Patterns
Literal patterns
^^^^^^^^^^^^^^^^

A literal pattern corresponds to most
Expand Down Expand Up @@ -874,7 +874,7 @@ the singletons ``None``, ``True`` and ``False``, the :keyword:`is` operator is u

.. _capture-patterns:

Capture Patterns
Capture patterns
^^^^^^^^^^^^^^^^

A capture pattern binds the subject value to a name.
Expand All @@ -899,7 +899,7 @@ In simple terms ``NAME`` will always succeed and it will set ``NAME = <subject>`

.. _wildcard-patterns:

Wildcard Patterns
Wildcard patterns
^^^^^^^^^^^^^^^^^

A wildcard pattern always succeeds (matches anything)
Expand All @@ -916,7 +916,7 @@ In simple terms, ``_`` will always succeed.

.. _value-patterns:

Value Patterns
Value patterns
^^^^^^^^^^^^^^

A value pattern represents a named value in Python.
Expand All @@ -943,7 +943,7 @@ In simple terms ``NAME1.NAME2`` will succeed only if ``<subject> == NAME1.NAME2`

.. _group-patterns:

Group Patterns
Group patterns
^^^^^^^^^^^^^^

A group pattern allows users to add parentheses around patterns to
Expand All @@ -957,7 +957,7 @@ In simple terms ``(P)`` has the same effect as ``P``.

.. _sequence-patterns:

Sequence Patterns
Sequence patterns
^^^^^^^^^^^^^^^^^

A sequence pattern contains several subpatterns to be matched against sequence elements.
Expand Down Expand Up @@ -1039,7 +1039,7 @@ happens:

.. _mapping-patterns:

Mapping Patterns
Mapping patterns
^^^^^^^^^^^^^^^^

A mapping pattern contains one or more key-value patterns. The syntax is
Expand Down Expand Up @@ -1089,7 +1089,7 @@ happens:

.. _class-patterns:

Class Patterns
Class patterns
^^^^^^^^^^^^^^

A class pattern represents a class and its positional and keyword arguments
Expand Down
Loading