PEP 634: Fix duplicate labels (#2735)

This commit is contained in:
Hugo van Kemenade 2022-07-28 14:49:29 +03:00 committed by GitHub
parent fb6151d92b
commit cf3b2e1f26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 20 deletions

View File

@ -35,7 +35,7 @@ introduction to the concepts, syntax and semantics of patterns.
Syntax and Semantics
====================
See `Appendix A`_ for the complete grammar.
See :ref:`Appendix A <634-appendix-a>` for the complete grammar.
Overview and Terminology
------------------------
@ -134,7 +134,7 @@ The precise pattern binding rules vary per pattern type and are
specified below.
.. _guards:
.. _634-guards:
Guards
^^^^^^
@ -169,7 +169,7 @@ A match statement may have at most one irrefutable case block, and it
must be last.
.. _patterns:
.. _634-patterns:
Patterns
--------
@ -225,7 +225,7 @@ until one succeeds. The OR pattern is then deemed to succeed.
If none of the subpatterns succeed the OR pattern fails.
.. _literal_pattern:
.. _634-literal_pattern:
Literal Patterns
^^^^^^^^^^^^^^^^
@ -261,7 +261,7 @@ value expressed by the literal, using the following comparisons rules:
using the ``is`` operator.
.. _capture_pattern:
.. _634-capture_pattern:
Capture Patterns
^^^^^^^^^^^^^^^^
@ -284,7 +284,7 @@ disallows for example ``case x, x: ...`` but allows ``case [x] | x:
...``.
.. _wildcard_pattern:
.. _634-wildcard_pattern:
Wildcard Pattern
^^^^^^^^^^^^^^^^
@ -331,7 +331,7 @@ A parenthesized pattern has no additional syntax. It allows users to
add parentheses around patterns to emphasize the intended grouping.
.. _sequence_pattern:
.. _634-sequence_pattern:
Sequence Patterns
^^^^^^^^^^^^^^^^^
@ -411,7 +411,7 @@ then matched to the corresponding subject items, as for a fixed-length
sequence.
.. _mapping_pattern:
.. _634-mapping_pattern:
Mapping Patterns
^^^^^^^^^^^^^^^^
@ -466,7 +466,7 @@ with keys that were already present when the match statement was
entered.
.. _class_pattern:
.. _634-class_pattern:
Class Patterns
^^^^^^^^^^^^^^
@ -592,7 +592,7 @@ existing standard library classes and adding ``__match_args__`` where
it looks beneficial.
.. _Appendix A:
.. _634-appendix-a:
Appendix A -- Full Grammar
==========================
@ -682,13 +682,3 @@ Copyright
This document is placed in the public domain or under the
CC0-1.0-Universal license, whichever is more permissive.
..
Local Variables:
mode: indented-text
indent-tabs-mode: nil
sentence-end-double-space: t
fill-column: 70
coding: utf-8
End: