Skip to content

Commit dee3428

Browse files
[3.14] gh-101100: Resolve reference warnings in reference/ (GH-138418) (#138680)
gh-101100: Resolve reference warnings in reference/ (GH-138418) (cherry picked from commit 6831634) Co-authored-by: Adam Turner <[email protected]>
1 parent 2162fcc commit dee3428

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,9 @@ The match statement is used for pattern matching. Syntax:
610610

611611
.. productionlist:: python-grammar
612612
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
613-
subject_expr: `star_named_expression` "," `star_named_expressions`?
614-
: | `named_expression`
615-
case_block: 'case' `patterns` [`guard`] ":" `block`
613+
subject_expr: `!star_named_expression` "," `!star_named_expressions`?
614+
: | `!named_expression`
615+
case_block: 'case' `patterns` [`guard`] ":" `!block`
616616

617617
.. note::
618618
This section uses single quotes to denote
@@ -701,7 +701,7 @@ Guards
701701
.. index:: ! guard
702702

703703
.. productionlist:: python-grammar
704-
guard: "if" `named_expression`
704+
guard: "if" `!named_expression`
705705

706706
A ``guard`` (which is part of the ``case``) must succeed for code inside
707707
the ``case`` block to execute. It takes the form: :keyword:`if` followed by an
@@ -1015,8 +1015,8 @@ subject value:
10151015
items, as for a fixed-length sequence.
10161016

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

10221022

Doc/reference/datamodel.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Sets
453453

454454
These represent a mutable set. They are created by the built-in :func:`set`
455455
constructor and can be modified afterwards by several methods, such as
456-
:meth:`~set.add`.
456+
:meth:`add <frozenset.add>`.
457457

458458

459459
Frozen sets
@@ -1272,7 +1272,7 @@ Special attributes
12721272
* - .. attribute:: type.__firstlineno__
12731273
- The line number of the first line of the class definition,
12741274
including decorators.
1275-
Setting the :attr:`__module__` attribute removes the
1275+
Setting the :attr:`~type.__module__` attribute removes the
12761276
:attr:`!__firstlineno__` item from the type's dictionary.
12771277

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

19101910

19111911
.. _customization:
@@ -2697,7 +2697,7 @@ class defining the method.
26972697
.. versionadded:: 3.6
26982698

26992699

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

27032703
.. method:: object.__set_name__(self, owner, name)
@@ -3143,7 +3143,7 @@ objects. The :mod:`collections.abc` module provides a
31433143
Mutable sequences should provide methods :meth:`~sequence.append`,
31443144
:meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`,
31453145
:meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`,
3146-
:meth:`~sequence.reverse` and :meth:`~sequence.sort`,
3146+
:meth:`~sequence.reverse` and :meth:`!sort`,
31473147
like Python standard :class:`list` objects.
31483148
Finally, sequence types should implement addition (meaning concatenation) and
31493149
multiplication (meaning repetition) by defining the methods

Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ Doc/library/xml.sax.rst
5454
Doc/library/xmlrpc.client.rst
5555
Doc/library/xmlrpc.server.rst
5656
Doc/library/zlib.rst
57-
Doc/reference/compound_stmts.rst
58-
Doc/reference/datamodel.rst
5957
Doc/whatsnew/2.4.rst
6058
Doc/whatsnew/2.5.rst
6159
Doc/whatsnew/2.6.rst

0 commit comments

Comments
 (0)