PEP 634: Fix duplicate labels (#2735)
This commit is contained in:
parent
fb6151d92b
commit
cf3b2e1f26
30
pep-0634.rst
30
pep-0634.rst
|
@ -35,7 +35,7 @@ introduction to the concepts, syntax and semantics of patterns.
|
||||||
Syntax and Semantics
|
Syntax and Semantics
|
||||||
====================
|
====================
|
||||||
|
|
||||||
See `Appendix A`_ for the complete grammar.
|
See :ref:`Appendix A <634-appendix-a>` for the complete grammar.
|
||||||
|
|
||||||
Overview and Terminology
|
Overview and Terminology
|
||||||
------------------------
|
------------------------
|
||||||
|
@ -134,7 +134,7 @@ The precise pattern binding rules vary per pattern type and are
|
||||||
specified below.
|
specified below.
|
||||||
|
|
||||||
|
|
||||||
.. _guards:
|
.. _634-guards:
|
||||||
|
|
||||||
Guards
|
Guards
|
||||||
^^^^^^
|
^^^^^^
|
||||||
|
@ -169,7 +169,7 @@ A match statement may have at most one irrefutable case block, and it
|
||||||
must be last.
|
must be last.
|
||||||
|
|
||||||
|
|
||||||
.. _patterns:
|
.. _634-patterns:
|
||||||
|
|
||||||
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.
|
If none of the subpatterns succeed the OR pattern fails.
|
||||||
|
|
||||||
|
|
||||||
.. _literal_pattern:
|
.. _634-literal_pattern:
|
||||||
|
|
||||||
Literal Patterns
|
Literal Patterns
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
@ -261,7 +261,7 @@ value expressed by the literal, using the following comparisons rules:
|
||||||
using the ``is`` operator.
|
using the ``is`` operator.
|
||||||
|
|
||||||
|
|
||||||
.. _capture_pattern:
|
.. _634-capture_pattern:
|
||||||
|
|
||||||
Capture Patterns
|
Capture Patterns
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
@ -284,7 +284,7 @@ disallows for example ``case x, x: ...`` but allows ``case [x] | x:
|
||||||
...``.
|
...``.
|
||||||
|
|
||||||
|
|
||||||
.. _wildcard_pattern:
|
.. _634-wildcard_pattern:
|
||||||
|
|
||||||
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.
|
add parentheses around patterns to emphasize the intended grouping.
|
||||||
|
|
||||||
|
|
||||||
.. _sequence_pattern:
|
.. _634-sequence_pattern:
|
||||||
|
|
||||||
Sequence Patterns
|
Sequence Patterns
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
@ -411,7 +411,7 @@ then matched to the corresponding subject items, as for a fixed-length
|
||||||
sequence.
|
sequence.
|
||||||
|
|
||||||
|
|
||||||
.. _mapping_pattern:
|
.. _634-mapping_pattern:
|
||||||
|
|
||||||
Mapping Patterns
|
Mapping Patterns
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
@ -466,7 +466,7 @@ with keys that were already present when the match statement was
|
||||||
entered.
|
entered.
|
||||||
|
|
||||||
|
|
||||||
.. _class_pattern:
|
.. _634-class_pattern:
|
||||||
|
|
||||||
Class Patterns
|
Class Patterns
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
@ -592,7 +592,7 @@ existing standard library classes and adding ``__match_args__`` where
|
||||||
it looks beneficial.
|
it looks beneficial.
|
||||||
|
|
||||||
|
|
||||||
.. _Appendix A:
|
.. _634-appendix-a:
|
||||||
|
|
||||||
Appendix A -- Full Grammar
|
Appendix A -- Full Grammar
|
||||||
==========================
|
==========================
|
||||||
|
@ -682,13 +682,3 @@ Copyright
|
||||||
|
|
||||||
This document is placed in the public domain or under the
|
This document is placed in the public domain or under the
|
||||||
CC0-1.0-Universal license, whichever is more permissive.
|
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:
|
|
||||||
|
|
Loading…
Reference in New Issue