Skip to content

Commit e1dbe22

Browse files
miss-islingtonAA-TurnerStanFromIreland
authored
[3.13] gh-101100: Resolve reference warnings in reference/ (GH-138418) (#138681)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
1 parent 0151abc commit e1dbe22

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ The :keyword:`for` statement is used to iterate over the elements of a sequence
154154
(such as a string, tuple or list) or other iterable object:
155155

156156
.. productionlist:: python-grammar
157-
for_stmt: "for" `target_list` "in" `starred_list` ":" `suite`
157+
for_stmt: "for" `target_list` "in" `!starred_list` ":" `suite`
158158
: ["else" ":" `suite`]
159159

160160
The ``starred_list`` expression is evaluated once; it should yield an
@@ -608,9 +608,9 @@ The match statement is used for pattern matching. Syntax:
608608

609609
.. productionlist:: python-grammar
610610
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
611-
subject_expr: `star_named_expression` "," `star_named_expressions`?
612-
: | `named_expression`
613-
case_block: 'case' `patterns` [`guard`] ":" `block`
611+
subject_expr: `!star_named_expression` "," `!star_named_expressions`?
612+
: | `!named_expression`
613+
case_block: 'case' `patterns` [`guard`] ":" `!block`
614614

615615
.. note::
616616
This section uses single quotes to denote
@@ -699,7 +699,7 @@ Guards
699699
.. index:: ! guard
700700

701701
.. productionlist:: python-grammar
702-
guard: "if" `named_expression`
702+
guard: "if" `!named_expression`
703703

704704
A ``guard`` (which is part of the ``case``) must succeed for code inside
705705
the ``case`` block to execute. It takes the form: :keyword:`if` followed by an
@@ -844,7 +844,7 @@ A literal pattern corresponds to most
844844
literal_pattern: `signed_number`
845845
: | `signed_number` "+" NUMBER
846846
: | `signed_number` "-" NUMBER
847-
: | `strings`
847+
: | `!strings`
848848
: | "None"
849849
: | "True"
850850
: | "False"
@@ -1013,8 +1013,8 @@ subject value:
10131013
items, as for a fixed-length sequence.
10141014

10151015
.. note:: The length of the subject sequence is obtained via
1016-
:func:`len` (i.e. via the :meth:`__len__` protocol). This length may be
1017-
cached by the interpreter in a similar manner as
1016+
:func:`len` (i.e. via the :meth:`~object.__len__` protocol).
1017+
This length may be cached by the interpreter in a similar manner as
10181018
:ref:`value patterns <value-patterns>`.
10191019

10201020

Doc/reference/datamodel.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ Special attributes
12351235
* - .. attribute:: type.__firstlineno__
12361236
- The line number of the first line of the class definition,
12371237
including decorators.
1238-
Setting the :attr:`__module__` attribute removes the
1238+
Setting the :attr:`~type.__module__` attribute removes the
12391239
:attr:`!__firstlineno__` item from the type's dictionary.
12401240

12411241
.. versionadded:: 3.13
@@ -1858,9 +1858,9 @@ falling back to :meth:`~object.__getitem__`). [#]_
18581858
When implementing a class that emulates any built-in type, it is important that
18591859
the emulation only be implemented to the degree that it makes sense for the
18601860
object being modelled. For example, some sequences may work well with retrieval
1861-
of individual elements, but extracting a slice may not make sense. (One example
1862-
of this is the :class:`~xml.dom.NodeList` interface in the W3C's Document
1863-
Object Model.)
1861+
of individual elements, but extracting a slice may not make sense.
1862+
(One example of this is the :ref:`NodeList <dom-nodelist-objects>` interface
1863+
in the W3C's Document Object Model.)
18641864

18651865

18661866
.. _customization:
@@ -2652,7 +2652,7 @@ class defining the method.
26522652
.. versionadded:: 3.6
26532653

26542654

2655-
When a class is created, :meth:`type.__new__` scans the class variables
2655+
When a class is created, :meth:`!type.__new__` scans the class variables
26562656
and makes callbacks to those with a :meth:`~object.__set_name__` hook.
26572657

26582658
.. method:: object.__set_name__(self, owner, name)

Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ Doc/library/xml.sax.reader.rst
4747
Doc/library/xml.sax.rst
4848
Doc/library/xmlrpc.client.rst
4949
Doc/library/xmlrpc.server.rst
50-
Doc/reference/compound_stmts.rst
51-
Doc/reference/datamodel.rst
5250
Doc/whatsnew/2.4.rst
5351
Doc/whatsnew/2.5.rst
5452
Doc/whatsnew/2.6.rst

0 commit comments

Comments
 (0)