Skip to content

Commit 586b25e

Browse files
AA-Turnermiss-islington
authored andcommitted
pythongh-101100: Resolve reference warnings in reference/ (pythonGH-138418)
(cherry picked from commit 6831634) Co-authored-by: Adam Turner <[email protected]>
1 parent 9a6137a commit 586b25e

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
@@ -603,9 +603,9 @@ The match statement is used for pattern matching. Syntax:
603603

604604
.. productionlist:: python-grammar
605605
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
606-
subject_expr: `star_named_expression` "," `star_named_expressions`?
607-
: | `named_expression`
608-
case_block: 'case' `patterns` [`guard`] ":" `block`
606+
subject_expr: `!star_named_expression` "," `!star_named_expressions`?
607+
: | `!named_expression`
608+
case_block: 'case' `patterns` [`guard`] ":" `!block`
609609

610610
.. note::
611611
This section uses single quotes to denote
@@ -694,7 +694,7 @@ Guards
694694
.. index:: ! guard
695695

696696
.. productionlist:: python-grammar
697-
guard: "if" `named_expression`
697+
guard: "if" `!named_expression`
698698

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

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

10151015

Doc/reference/datamodel.rst

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

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

453453

454454
Frozen sets
@@ -1224,7 +1224,7 @@ Special attributes
12241224
* - .. attribute:: type.__firstlineno__
12251225
- The line number of the first line of the class definition,
12261226
including decorators.
1227-
Setting the :attr:`__module__` attribute removes the
1227+
Setting the :attr:`~type.__module__` attribute removes the
12281228
:attr:`!__firstlineno__` item from the type's dictionary.
12291229

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

18541854

18551855
.. _customization:
@@ -2641,7 +2641,7 @@ class defining the method.
26412641
.. versionadded:: 3.6
26422642

26432643

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

26472647
.. method:: object.__set_name__(self, owner, name)
@@ -3087,7 +3087,7 @@ objects. The :mod:`collections.abc` module provides a
30873087
Mutable sequences should provide methods :meth:`~sequence.append`,
30883088
:meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`,
30893089
:meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`,
3090-
:meth:`~sequence.reverse` and :meth:`~sequence.sort`,
3090+
:meth:`~sequence.reverse` and :meth:`!sort`,
30913091
like Python standard :class:`list` objects.
30923092
Finally, sequence types should implement addition (meaning concatenation) and
30933093
multiplication (meaning repetition) by defining the methods

Doc/tools/.nitignore

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

0 commit comments

Comments
 (0)