]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (#104154)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Thu, 4 May 2023 08:39:15 +0000 (09:39 +0100)
committerGitHub <noreply@github.com>
Thu, 4 May 2023 08:39:15 +0000 (11:39 +0300)
33 files changed:
Doc/c-api/exceptions.rst
Doc/c-api/init.rst
Doc/c-api/intro.rst
Doc/library/_thread.rst
Doc/library/binascii.rst
Doc/library/cmath.rst
Doc/library/copy.rst
Doc/library/copyreg.rst
Doc/library/exceptions.rst
Doc/library/fnmatch.rst
Doc/library/functions.rst
Doc/library/http.client.rst
Doc/library/internet.rst
Doc/library/locale.rst
Doc/library/marshal.rst
Doc/library/os.path.rst
Doc/library/os.rst
Doc/library/pdb.rst
Doc/library/posix.rst
Doc/library/pwd.rst
Doc/library/pyexpat.rst
Doc/library/runpy.rst
Doc/library/shelve.rst
Doc/library/site.rst
Doc/library/socket.rst
Doc/library/stdtypes.rst
Doc/reference/compound_stmts.rst
Doc/reference/datamodel.rst
Doc/reference/executionmodel.rst
Doc/reference/toplevel_components.rst
Doc/tools/extensions/pyspecific.py
Doc/tutorial/inputoutput.rst
Doc/tutorial/modules.rst

index 087e0a61d12d59a22880001a29e22cd0c389d438..092e548fb8fd83f7e5e6569b47937aff86e05780 100644 (file)
@@ -543,7 +543,7 @@ Signal Handling
 .. c:function:: int PyErr_CheckSignals()
 
    .. index::
-      module: signal
+      pair: module; signal
       single: SIGINT
       single: KeyboardInterrupt (built-in exception)
 
@@ -574,7 +574,7 @@ Signal Handling
 .. c:function:: void PyErr_SetInterrupt()
 
    .. index::
-      module: signal
+      pair: module; signal
       single: SIGINT
       single: KeyboardInterrupt (built-in exception)
 
@@ -589,7 +589,7 @@ Signal Handling
 .. c:function:: int PyErr_SetInterruptEx(int signum)
 
    .. index::
-      module: signal
+      pair: module; signal
       single: KeyboardInterrupt (built-in exception)
 
    Simulate the effect of a signal arriving. The next time
index 615708ea2cce7c120566904b83b6cdf0c49f7b4f..dda87f4e31a42692ccec896e4919c97c8be3c216 100644 (file)
@@ -233,9 +233,9 @@ Initializing and finalizing the interpreter
       single: PyEval_InitThreads()
       single: modules (in module sys)
       single: path (in module sys)
-      module: builtins
-      module: __main__
-      module: sys
+      pair: module; builtins
+      pair: module; __main__
+      pair: module; sys
       triple: module; search; path
       single: PySys_SetArgv()
       single: PySys_SetArgvEx()
@@ -942,7 +942,7 @@ code, or when embedding the Python interpreter:
 
    .. deprecated:: 3.9
 
-   .. index:: module: _thread
+   .. index:: pair: module; _thread
 
 
 .. c:function:: int PyEval_ThreadsInitialized()
@@ -1385,9 +1385,9 @@ function. You can create and destroy them using the following functions:
 .. c:function:: PyThreadState* Py_NewInterpreter()
 
    .. index::
-      module: builtins
-      module: __main__
-      module: sys
+      pair: module; builtins
+      pair: module; __main__
+      pair: module; sys
       single: stdout (in module sys)
       single: stderr (in module sys)
       single: stdin (in module sys)
index a8f9e9b9963980104ff2d4a0fc36af325882b416..bd37ed58ffdf705c350031fdeb3f72e20e7d51fc 100644 (file)
@@ -705,9 +705,9 @@ interpreter can only be used after the interpreter has been initialized.
 
 .. index::
    single: Py_Initialize()
-   module: builtins
-   module: __main__
-   module: sys
+   pair: module; builtins
+   pair: module; __main__
+   pair: module; sys
    triple: module; search; path
    single: path (in module sys)
 
index ecd7a68e627feefeaf1f82e315ac9353ef9dc670..3d7e354d1e368d29c32e66dba85f2f94255799a6 100644 (file)
@@ -206,7 +206,7 @@ In addition to these methods, lock objects can also be used via the
 
 **Caveats:**
 
-  .. index:: module: signal
+  .. index:: pair: module; signal
 
 * Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt`
   exception will be received by an arbitrary thread.  (When the :mod:`signal`
index 5a0815faa38eac21f167e4d46e1bbe6014d46c9b..21960cb7972e6e9b3281a671ddc681edbdec2872 100644 (file)
@@ -6,8 +6,8 @@
               representations.
 
 .. index::
-   module: uu
-   module: base64
+   pair: module; uu
+   pair: module; base64
 
 --------------
 
index 5ed7a09b3e9db28487aa317ac969c5efe9b07840..b17d58e1cc0ce1de23e9dc97fc47dad20ea08349 100644 (file)
@@ -301,7 +301,7 @@ Constants
    .. versionadded:: 3.6
 
 
-.. index:: module: math
+.. index:: pair: module; math
 
 Note that the selection of functions is similar, but not identical, to that in
 module :mod:`math`.  The reason for having two modules is that some users aren't
index a8bc2fa55ea8c31b48913c3bca241e6022bb6c72..8f32477ed508c372ba57e3b73d255df80206c4ae 100644 (file)
@@ -68,7 +68,7 @@ Shallow copies of dictionaries can be made using :meth:`dict.copy`, and
 of lists by assigning a slice of the entire list, for example,
 ``copied_list = original_list[:]``.
 
-.. index:: module: pickle
+.. index:: pair: module; pickle
 
 Classes can use the same interfaces to control copying that they use to control
 pickling.  See the description of module :mod:`pickle` for information on these
index afc3e66f0bf7ac51eaef5b61a20f3159cb99c9b1..2a28c043f807233f6188d67cf30e6e40a27d926b 100644 (file)
@@ -7,8 +7,8 @@
 **Source code:** :source:`Lib/copyreg.py`
 
 .. index::
-   module: pickle
-   module: copy
+   pair: module; pickle
+   pair: module; copy
 
 --------------
 
index 18c3f47dddc0799cf1aee4c18ab19ec4b7ae6985..aee1cb5cc6a4752277be390d3ba3dd1968658d90 100644 (file)
@@ -318,7 +318,7 @@ The following exceptions are the exceptions that are usually raised.
 .. exception:: OSError([arg])
                OSError(errno, strerror[, filename[, winerror[, filename2]]])
 
-   .. index:: module: errno
+   .. index:: pair: module; errno
 
    This exception is raised when a system function returns a system-related
    error, including I/O failures such as "file not found" or "disk full"
index 46bf0fc2848058f5133cea20f042316aab71942b..aed8991d44772f5719f113c186ecc800b4068efa 100644 (file)
@@ -8,7 +8,7 @@
 
 .. index:: single: filenames; wildcard expansion
 
-.. index:: module: re
+.. index:: pair: module; re
 
 --------------
 
@@ -38,7 +38,7 @@ special characters used in shell-style wildcards are:
 For a literal match, wrap the meta-characters in brackets.
 For example, ``'[?]'`` matches the character ``'?'``.
 
-.. index:: module: glob
+.. index:: pair: module; glob
 
 Note that the filename separator (``'/'`` on Unix) is *not* special to this
 module.  See module :mod:`glob` for pathname expansion (:mod:`glob` uses
index 1c3deb2e78c76233da035d8e90ff83be69e63c3c..53294aa901a5b01ce47302d49a4c51d06fc6044a 100644 (file)
@@ -1339,7 +1339,7 @@ are always available.  They are listed here in alphabetical order.
       single: I/O control; buffering
       single: binary mode
       single: text mode
-      module: sys
+      pair: module; sys
 
    See also the file handling modules, such as :mod:`fileinput`, :mod:`io`
    (where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`,
@@ -1979,7 +1979,7 @@ are always available.  They are listed here in alphabetical order.
 
    .. index::
       statement: import
-      module: imp
+      pair: module; builtins
 
    .. note::
 
index bf0bf0f8c530a7f00de25c6ad5151c33545cd61b..9aeb07fade82a2b1b5fa5f6973d777a6db7297b8 100644 (file)
@@ -10,7 +10,7 @@
    pair: HTTP; protocol
    single: HTTP; http.client (standard module)
 
-.. index:: module: urllib.request
+.. index:: pair: module; urllib.request
 
 --------------
 
index ff58dcf4d89c36f26c9956e936bd6f234ed9514d..681769a4820dba6d9a44bb652f4bbb6d0484fc68 100644 (file)
@@ -9,7 +9,7 @@ Internet Protocols and Support
    single: Internet
    single: World Wide Web
 
-.. index:: module: socket
+.. index:: pair: module; socket
 
 The modules described in this chapter implement internet protocols and  support
 for related technology.  They are all implemented in Python. Most of these
index 0614930cb01eab229d6d2093928518437fee36fc..2948105d2925c418057efad2e2f4e9bc7d619cf8 100644 (file)
@@ -16,7 +16,7 @@ functionality. The POSIX locale mechanism allows programmers to deal with
 certain cultural issues in an application, without requiring the programmer to
 know all the specifics of each country where the software is executed.
 
-.. index:: module: _locale
+.. index:: pair: module; _locale
 
 The :mod:`locale` module is implemented on top of the :mod:`_locale` module,
 which in turn uses an ANSI C locale implementation if available.
@@ -476,7 +476,7 @@ The :mod:`locale` module defines the following exception and functions:
 
 .. data:: LC_CTYPE
 
-   .. index:: module: string
+   .. index:: pair: module; string
 
    Locale category for the character type functions.  Depending on the settings of
    this category, the functions of module :mod:`string` dealing with case change
index 24f9dc1689da4a20300ae5d624edb4c5ab987ee7..0556f19699dc15848c350f01180305fd3fbbf447 100644 (file)
@@ -15,8 +15,8 @@ undocumented on purpose; it may change between Python versions (although it
 rarely does). [#]_
 
 .. index::
-   module: pickle
-   module: shelve
+   pair: module; pickle
+   pair: module; shelve
 
 This is not a general "persistence" module.  For general persistence and
 transfer of Python objects through RPC calls, see the modules :mod:`pickle` and
index 22d07c47383839bd9b0f186e74188d40ed58b6ae..1a6b121de186a1c1b3568de898029b4f216da0b2 100644 (file)
@@ -159,7 +159,7 @@ the :mod:`glob` module.)
    On Unix and Windows, return the argument with an initial component of ``~`` or
    ``~user`` replaced by that *user*'s home directory.
 
-   .. index:: module: pwd
+   .. index:: pair: module; pwd
 
    On Unix, an initial ``~`` is replaced by the environment variable :envvar:`HOME`
    if it is set; otherwise the current user's home directory is looked up in the
index 19e5bee34e8495aebf55f45d40c802af2f59abb3..b4812e25256b6a99e65da85e88e8bcb2fb102318 100644 (file)
@@ -1185,7 +1185,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
 
 .. function:: openpty()
 
-   .. index:: module: pty
+   .. index:: pair: module; pty
 
    Open a new pseudo-terminal pair. Return a pair of file descriptors
    ``(master, slave)`` for the pty and the tty, respectively. The new file
@@ -2707,7 +2707,7 @@ features:
    possible and call :func:`lstat` on the result. This does not apply to
    dangling symlinks or junction points, which will raise the usual exceptions.
 
-   .. index:: module: stat
+   .. index:: pair: module; stat
 
    Example::
 
index a556fcc30877b68da748b767ab36d10f9fcabc47..8798155764b1ca9c51ba3b524d404945c9225c82 100644 (file)
@@ -20,8 +20,8 @@ supports post-mortem debugging and can be called under program control.
 
 .. index::
    single: Pdb (class in pdb)
-   module: bdb
-   module: cmd
+   pair: module; bdb
+   pair: module; cmd
 
 The debugger is extensible -- it is actually defined as the class :class:`Pdb`.
 This is currently undocumented but easily understood by reading the source.  The
index ec04b0dcfc162f633caf9503a1130dbe6533f181..0413f9d02a8d57bb39233def592d8c91de910e33 100644 (file)
@@ -11,7 +11,7 @@ This module provides access to operating system functionality that is
 standardized by the C Standard and the POSIX standard (a thinly disguised Unix
 interface).
 
-.. index:: module: os
+.. index:: pair: module; os
 
 **Do not import this module directly.**  Instead, import the module :mod:`os`,
 which provides a *portable* version of this interface.  On Unix, the :mod:`os`
index 98f3c45e29cbcbcd62cd27e0d8a11db4e5521bf5..7cafc66fd7e93ca6b3bba4ba77546c127a8ec59e 100644 (file)
@@ -39,7 +39,7 @@ raised if the entry asked for cannot be found.
 
 .. note::
 
-   .. index:: module: crypt
+   .. index:: pair: module; crypt
 
    In traditional Unix the field ``pw_passwd`` usually contains a password
    encrypted with a DES derived algorithm (see module :mod:`crypt`).  However most
index d6581e21b01c0e9be1244847ef8cf9edf06ef8ed..935e872480efda7be7f691f02690d04666178e09 100644 (file)
@@ -33,7 +33,7 @@ can be set to handler functions.  When an XML document is then fed to the
 parser, the handler functions are called for the character data and markup in
 the XML document.
 
-.. index:: module: pyexpat
+.. index:: pair: module; pyexpat
 
 This module uses the :mod:`pyexpat` module to provide access to the Expat
 parser.  Direct use of the :mod:`pyexpat` module is deprecated.
index 26a4f1435214e8ef82c69069609e3b01ad842301..e161458040f8966a26f6ef55c964d45ec3f1009d 100644 (file)
@@ -30,7 +30,7 @@ The :mod:`runpy` module provides two functions:
 .. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=False)
 
    .. index::
-      module: __main__
+      pair: module; __main__
 
    Execute the code of the specified module and return the resulting module
    globals dictionary. The module's code is first located using the standard
@@ -96,7 +96,7 @@ The :mod:`runpy` module provides two functions:
 .. function:: run_path(path_name, init_globals=None, run_name=None)
 
    .. index::
-      module: __main__
+      pair: module; __main__
 
    Execute the code at the named filesystem location and return the resulting
    module globals dictionary. As with a script name supplied to the CPython
index a50fc6f0bf77b208b9633a783333f8bb9636852e..dc87af398ed757dce895673cc2886ffad06fb08a 100644 (file)
@@ -6,7 +6,7 @@
 
 **Source code:** :source:`Lib/shelve.py`
 
-.. index:: module: pickle
+.. index:: pair: module; pickle
 
 --------------
 
@@ -95,8 +95,8 @@ Restrictions
 ------------
 
   .. index::
-     module: dbm.ndbm
-     module: dbm.gnu
+     pair: module; dbm.ndbm
+     pair: module; dbm.gnu
 
 * The choice of which database package will be used (such as :mod:`dbm.ndbm` or
   :mod:`dbm.gnu`) depends on which interface is available.  Therefore it is not
index 5941739ee6942f7a8979608f2bee13f1cae40138..34b38f4d56f3cf12c11b3ca68e5c89d498ca7219 100644 (file)
@@ -109,7 +109,7 @@ directory precedes the :file:`foo` directory because :file:`bar.pth` comes
 alphabetically before :file:`foo.pth`; and :file:`spam` is omitted because it is
 not mentioned in either path configuration file.
 
-.. index:: module: sitecustomize
+.. index:: pair: module; sitecustomize
 
 After these path manipulations, an attempt is made to import a module named
 :mod:`sitecustomize`, which can perform arbitrary site-specific customizations.
@@ -121,7 +121,7 @@ with :file:`pythonw.exe` on Windows (which is used by default to start IDLE),
 attempted output from :mod:`sitecustomize` is ignored.  Any other exception
 causes a silent and perhaps mysterious failure of the process.
 
-.. index:: module: usercustomize
+.. index:: pair: module; usercustomize
 
 After this, an attempt is made to import a module named :mod:`usercustomize`,
 which can perform arbitrary user-specific customizations, if
index d1b5a1ceb73795c1eb3d8f87470e4c831f6e400f..e222dc70e4220c1bf7b9104453cf68ecf336e20f 100644 (file)
@@ -1829,7 +1829,7 @@ to sockets.
 .. method:: socket.setsockopt(level, optname, None, optlen: int)
    :noindex:
 
-   .. index:: module: struct
+   .. index:: pair: module; struct
 
    Set the value of the given socket option (see the Unix manual page
    :manpage:`setsockopt(2)`).  The needed symbolic constants are defined in the
index e7d43b2809ac5a7503dfa8d22829443c0a0abef5..2199829660a7b3747a7d7bd075c74d4b6c27bcf4 100644 (file)
@@ -330,7 +330,7 @@ Notes:
 
 (3)
    .. index::
-      module: math
+      pair: module; math
       single: floor() (in module math)
       single: ceil() (in module math)
       single: trunc() (in module math)
@@ -1561,7 +1561,7 @@ String Methods
 --------------
 
 .. index::
-   module: re
+   pair: module; re
 
 Strings implement all of the :ref:`common <typesseq-common>` sequence
 operations, along with the additional methods described below.
@@ -2467,7 +2467,7 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
    object: bytes
    object: bytearray
    object: memoryview
-   module: array
+   pair: module; array
 
 The core built-in types for manipulating binary data are :class:`bytes` and
 :class:`bytearray`. They are supported by :class:`memoryview` which uses
@@ -5325,7 +5325,7 @@ Type Objects
 
 .. index::
    builtin: type
-   module: types
+   pair: module; types
 
 Type objects represent the various object types.  An object's type is accessed
 by the built-in function :func:`type`.  There are no special operations on
index 54228b8a4e60fc83a1aafcce601d9c9d6e202ce3..ade59dbe4394d2e88c12cadd24d133f01ae7518b 100644 (file)
@@ -297,7 +297,7 @@ traceback attached to them, they form a reference cycle with the stack frame,
 keeping all locals in that frame alive until the next garbage collection occurs.
 
 .. index::
-   module: sys
+   pair: module; sys
    object: traceback
 
 Before an :keyword:`!except` clause's suite is executed,
index 277b9e5aa2477e14295d4a6ab778fde46d743e39..e8117d982c2ae587bd7bdcc3c71f288d3e25ef7c 100644 (file)
@@ -377,7 +377,7 @@ Sequences
          (and hence unhashable), byte arrays otherwise provide the same interface
          and functionality as immutable :class:`bytes` objects.
 
-      .. index:: module: array
+      .. index:: pair: module; array
 
       The extension module :mod:`array` provides an additional example of a
       mutable sequence type, as does the :mod:`collections` module.
@@ -451,8 +451,8 @@ Mappings
       section :ref:`dict`).
 
       .. index::
-         module: dbm.ndbm
-         module: dbm.gnu
+         pair: module; dbm.ndbm
+         pair: module; dbm.gnu
 
       The extension modules :mod:`dbm.ndbm` and :mod:`dbm.gnu` provide
       additional examples of mapping types, as does the :mod:`collections`
@@ -909,7 +909,7 @@ Class instances
 I/O objects (also known as file objects)
    .. index::
       builtin: open
-      module: io
+      pair: module; io
       single: popen() (in module os)
       single: makefile() (socket method)
       single: sys.stdin
index a264015cbf40496cad634928dddeda8e497ff6ca..8917243999d399d222939d1899dfa8d367060267 100644 (file)
@@ -151,7 +151,7 @@ to previously bound variables in the nearest enclosing function scope.
 :exc:`SyntaxError` is raised at compile time if the given name does not
 exist in any enclosing function scope.
 
-.. index:: module: __main__
+.. index:: pair: module; __main__
 
 The namespace for a module is automatically created the first time a module is
 imported.  The main module for a script is always called :mod:`__main__`.
index 319c9de484241e231de677f91aee4a425ec127cf..ee472ace6e2129462de0529be08b1493ae4b0976 100644 (file)
@@ -21,9 +21,9 @@ Complete Python programs
 .. index:: single: program
 
 .. index::
-   module: sys
-   module: __main__
-   module: builtins
+   pair: module; sys
+   pair: module; __main__
+   pair: module; builtins
 
 While a language specification need not prescribe how the language interpreter
 is invoked, it is useful to have a notion of a complete Python program.  A
@@ -38,7 +38,7 @@ the next section.
 
 .. index::
    single: interactive mode
-   module: __main__
+   pair: module; __main__
 
 The interpreter may also be invoked in interactive mode; in this case, it does
 not read and execute a complete program but reads and executes one statement
index 3ff2a91b1fef0acc95216af1c5a4b559ef530f96..1888428437a6d5c19c2ac6bfbfe7974045f7a43b 100644 (file)
@@ -694,7 +694,7 @@ def patch_pairindextypes(app) -> None:
         # away from this, we need Sphinx to believe that these values don't
         # exist, by deleting them when using the gettext builder.
 
-        pairindextypes.pop('module', None)
+        pairindextypes.pop('module', None)
         # pairindextypes.pop('keyword', None)
         # pairindextypes.pop('operator', None)
         # pairindextypes.pop('object', None)
@@ -702,10 +702,6 @@ def patch_pairindextypes(app) -> None:
         # pairindextypes.pop('statement', None)
         # pairindextypes.pop('builtin', None)
 
-        # there needs to be at least one statement in this block, will be
-        # removed when the first of the below is uncommented.
-        pass
-
 
 def setup(app):
     app.add_role('issue', issue_role)
index 3581b3727a53eac85905d358f5198754d4819afc..aeacc1559a228c349bb22c11867b5a85d11412c4 100644 (file)
@@ -466,7 +466,7 @@ Reference for a complete guide to file objects.
 Saving structured data with :mod:`json`
 ---------------------------------------
 
-.. index:: module: json
+.. index:: pair: module; json
 
 Strings can easily be written to and read from a file.  Numbers take a bit more
 effort, since the :meth:`read` method only returns strings, which will have to
index 4daafa49a34d2e645ff96e7a604bb0c2eb0482ad..3bd034bcc9703f8d59a6cb1b211dc66d6d53a633 100644 (file)
@@ -264,7 +264,7 @@ Some tips for experts:
 Standard Modules
 ================
 
-.. index:: module: sys
+.. index:: pair: module; sys
 
 Python comes with a library of standard modules, described in a separate
 document, the Python Library Reference ("Library Reference" hereafter).  Some
@@ -345,7 +345,7 @@ Without arguments, :func:`dir` lists the names you have defined currently::
 
 Note that it lists all types of names: variables, modules, functions, etc.
 
-.. index:: module: builtins
+.. index:: pair: module; builtins
 
 :func:`dir` does not list the names of built-in functions and variables.  If you
 want a list of those, they are defined in the standard module