https://github.com/python/cpython/commit/6831634eb71360b0bd1b266d42fe24a930f38078
commit: 6831634eb71360b0bd1b266d42fe24a930f38078
branch: main
author: Adam Turner <[email protected]>
committer: AA-Turner <[email protected]>
date: 2025-09-08T19:31:24Z
summary:

gh-101100: Resolve reference warnings in reference/ (#138418)

files:
M Doc/reference/compound_stmts.rst
M Doc/reference/datamodel.rst
M Doc/tools/.nitignore

diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 05f05bc41a217f..9dca276e4a0001 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -610,9 +610,9 @@ The match statement is used for pattern matching.  Syntax:
 
 .. productionlist:: python-grammar
    match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
-   subject_expr: `star_named_expression` "," `star_named_expressions`?
-               : | `named_expression`
-   case_block: 'case' `patterns` [`guard`] ":" `block`
+   subject_expr: `!star_named_expression` "," `!star_named_expressions`?
+               : | `!named_expression`
+   case_block: 'case' `patterns` [`guard`] ":" `!block`
 
 .. note::
    This section uses single quotes to denote
@@ -701,7 +701,7 @@ Guards
 .. index:: ! guard
 
 .. productionlist:: python-grammar
-   guard: "if" `named_expression`
+   guard: "if" `!named_expression`
 
 A ``guard`` (which is part of the ``case``) must succeed for code inside
 the ``case`` block to execute.  It takes the form: :keyword:`if` followed by an
@@ -1015,8 +1015,8 @@ subject value:
       items, as for a fixed-length sequence.
 
    .. note:: The length of the subject sequence is obtained via
-      :func:`len` (i.e. via the :meth:`__len__` protocol).  This length may be
-      cached by the interpreter in a similar manner as
+      :func:`len` (i.e. via the :meth:`~object.__len__` protocol).
+      This length may be cached by the interpreter in a similar manner as
       :ref:`value patterns <value-patterns>`.
 
 
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index ba0071631adfc0..68645d1da3d351 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -453,7 +453,7 @@ Sets
 
    These represent a mutable set. They are created by the built-in :func:`set`
    constructor and can be modified afterwards by several methods, such as
-   :meth:`~set.add`.
+   :meth:`add <frozenset.add>`.
 
 
 Frozen sets
@@ -1272,7 +1272,7 @@ Special attributes
    * - .. attribute:: type.__firstlineno__
      - The line number of the first line of the class definition,
        including decorators.
-       Setting the :attr:`__module__` attribute removes the
+       Setting the :attr:`~type.__module__` attribute removes the
        :attr:`!__firstlineno__` item from the type's dictionary.
 
        .. versionadded:: 3.13
@@ -1903,9 +1903,9 @@ falling back to :meth:`~object.__getitem__`). [#]_
 When implementing a class that emulates any built-in type, it is important that
 the emulation only be implemented to the degree that it makes sense for the
 object being modelled.  For example, some sequences may work well with 
retrieval
-of individual elements, but extracting a slice may not make sense.  (One 
example
-of this is the :class:`~xml.dom.NodeList` interface in the W3C's Document
-Object Model.)
+of individual elements, but extracting a slice may not make sense.
+(One example of this is the :ref:`NodeList <dom-nodelist-objects>` interface
+in the W3C's Document Object Model.)
 
 
 .. _customization:
@@ -2697,7 +2697,7 @@ class defining the method.
    .. versionadded:: 3.6
 
 
-When a class is created, :meth:`type.__new__` scans the class variables
+When a class is created, :meth:`!type.__new__` scans the class variables
 and makes callbacks to those with a :meth:`~object.__set_name__` hook.
 
 .. method:: object.__set_name__(self, owner, name)
@@ -3145,7 +3145,7 @@ objects.  The :mod:`collections.abc` module provides a
 Mutable sequences should provide methods :meth:`~sequence.append`,
 :meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`,
 :meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`,
-:meth:`~sequence.reverse` and :meth:`~sequence.sort`,
+:meth:`~sequence.reverse` and :meth:`!sort`,
 like Python standard :class:`list` objects.
 Finally, sequence types should implement addition (meaning concatenation) and
 multiplication (meaning repetition) by defining the methods
diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore
index ad521f98162938..0ee92dce43790b 100644
--- a/Doc/tools/.nitignore
+++ b/Doc/tools/.nitignore
@@ -54,8 +54,6 @@ Doc/library/xml.sax.rst
 Doc/library/xmlrpc.client.rst
 Doc/library/xmlrpc.server.rst
 Doc/library/zlib.rst
-Doc/reference/compound_stmts.rst
-Doc/reference/datamodel.rst
 Doc/whatsnew/2.4.rst
 Doc/whatsnew/2.5.rst
 Doc/whatsnew/2.6.rst

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to