]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-120345: Fix incorrect use of the :class: role with the "()" suffix (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Jun 2024 14:51:35 +0000 (16:51 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2024 14:51:35 +0000 (14:51 +0000)
* Remove "()" when refer to a class as a type.
* Use :func: when refer to a callable.
* Fix reference to the datetime.astimezone() method.
(cherry picked from commit 92c9c6ae147e1e658bbc8d454f8c7b2c4dea31d1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/howto/descriptor.rst
Doc/library/collections.rst
Doc/library/datetime.rst
Doc/library/fileinput.rst
Doc/tutorial/stdlib2.rst
Doc/whatsnew/2.5.rst
Doc/whatsnew/3.12.rst

index 51f9f4a6556e57637b974ce58d4a2bdeb8863579..b29488be39a0a3802a9f865c08787bb311986e4a 100644 (file)
@@ -787,7 +787,7 @@ Invocation from super
 ---------------------
 
 The logic for super's dotted lookup is in the :meth:`__getattribute__` method for
-object returned by :class:`super()`.
+object returned by :func:`super`.
 
 A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__.__mro__``
 for the base class ``B`` immediately following ``A`` and then returns
index 2a269712f1814d0f6192758f8db989fecb83c527..ce89101d6b667c6b4ffce31ecdaea4af76641183 100644 (file)
@@ -99,7 +99,7 @@ The class can be used to simulate nested scopes and is useful in templating.
         :func:`super` function.  A reference to ``d.parents`` is equivalent to:
         ``ChainMap(*d.maps[1:])``.
 
-    Note, the iteration order of a :class:`ChainMap()` is determined by
+    Note, the iteration order of a :class:`ChainMap` is determined by
     scanning the mappings last to first::
 
         >>> baseline = {'music': 'bach', 'art': 'rembrandt'}
index 0723d0fe2fceb027b306bba84134125a1fb66ca5..b6d8e6e6df07faaf673642ab4e510729f9ca10ff 100644 (file)
@@ -2153,7 +2153,7 @@ There is one more :class:`tzinfo` method that a subclass may wish to override:
 
 .. method:: tzinfo.fromutc(dt)
 
-   This is called from the default :class:`datetime.astimezone()`
+   This is called from the default :meth:`datetime.astimezone`
    implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s
    date and time data are to be viewed as expressing a UTC time. The purpose
    of :meth:`fromutc` is to adjust the date and time data, returning an
index 94a4139f64c2e47409b37a43b5287accc6e3a9e7..8f32b11e565365288da4b6c919c1e285bb65cab6 100644 (file)
@@ -47,7 +47,7 @@ Lines are returned with any newlines intact, which means that the last line in
 a file may not have one.
 
 You can control how files are opened by providing an opening hook via the
-*openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The
+*openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The
 hook must be a function that takes two arguments, *filename* and *mode*, and
 returns an accordingly opened file-like object. If *encoding* and/or *errors*
 are specified, they will be passed to the hook as additional keyword arguments.
index 09b6f3d91bcfed7df287e58fd8e2691a5dea8133..8eaf5892558c8aa9ab90e2301359008f6d8d8b6d 100644 (file)
@@ -293,7 +293,7 @@ Many data structure needs can be met with the built-in list type. However,
 sometimes there is a need for alternative implementations with different
 performance trade-offs.
 
-The :mod:`array` module provides an :class:`~array.array()` object that is like
+The :mod:`array` module provides an :class:`~array.array` object that is like
 a list that stores only homogeneous data and stores it more compactly.  The
 following example shows an array of numbers stored as two byte unsigned binary
 numbers (typecode ``"H"``) rather than the usual 16 bytes per entry for regular
@@ -306,7 +306,7 @@ lists of Python int objects::
    >>> a[1:3]
    array('H', [10, 700])
 
-The :mod:`collections` module provides a :class:`~collections.deque()` object
+The :mod:`collections` module provides a :class:`~collections.deque` object
 that is like a list with faster appends and pops from the left side but slower
 lookups in the middle. These objects are well suited for implementing queues
 and breadth first tree searches::
index 2ae26e7a106a0bfefd82d10d30c505ddd8be49ac..3430ac8668e280c85215b0db6d311a6b38b8c5e9 100644 (file)
@@ -1724,7 +1724,7 @@ attribute of the function object to  change this::
 :mod:`ctypes` also provides a wrapper for Python's C API  as the
 ``ctypes.pythonapi`` object.  This object does *not*  release the global
 interpreter lock before calling a function, because the lock must be held when
-calling into the interpreter's code.   There's a :class:`py_object()` type
+calling into the interpreter's code.   There's a :class:`~ctypes.py_object` type
 constructor that will create a  :c:expr:`PyObject *` pointer.  A simple usage::
 
    import ctypes
@@ -1734,7 +1734,7 @@ constructor that will create a  :c:expr:`PyObject *` pointer.  A simple usage::
              ctypes.py_object("abc"),  ctypes.py_object(1))
    # d is now {'abc', 1}.
 
-Don't forget to use :class:`py_object()`; if it's omitted you end  up with a
+Don't forget to use :func:`~ctypes.py_object`; if it's omitted you end  up with a
 segmentation fault.
 
 :mod:`ctypes` has been around for a while, but people still write  and
index f3cabb71cb5568bc4a3c18807f7ae3757ddbe432..8e2c85a5821da2388d49acc2ea73c0fd8fcfcea8 100644 (file)
@@ -739,7 +739,7 @@ inspect
 itertools
 ---------
 
-* Add :class:`itertools.batched()` for collecting into even-sized
+* Add :func:`itertools.batched` for collecting into even-sized
   tuples where the last batch may be shorter than the rest.
   (Contributed by Raymond Hettinger in :gh:`98363`.)