Skip to content

Commit

Permalink
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed May 4, 2023
1 parent 8f94c94 commit 0056369
Show file tree
Hide file tree
Showing 33 changed files with 65 additions and 69 deletions.
6 changes: 3 additions & 3 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ Signal Handling
.. c:function:: int PyErr_CheckSignals()
.. index::
module: signal
pair: module; signal
single: SIGINT
single: KeyboardInterrupt (built-in exception)
Expand Down Expand Up @@ -574,7 +574,7 @@ Signal Handling
.. c:function:: void PyErr_SetInterrupt()
.. index::
module: signal
pair: module; signal
single: SIGINT
single: KeyboardInterrupt (built-in exception)
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/_thread.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/binascii.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
representations.

.. index::
module: uu
module: base64
pair: module; uu
pair: module; base64

--------------

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/cmath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/copy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/copyreg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
**Source code:** :source:`Lib/copyreg.py`

.. index::
module: pickle
module: copy
pair: module; pickle
pair: module; copy

--------------

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/fnmatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.. index:: single: filenames; wildcard expansion

.. index:: module: re
.. index:: pair: module; re

--------------

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -1979,7 +1979,7 @@ are always available. They are listed here in alphabetical order.

.. index::
statement: import
module: imp
pair: module; builtins

.. note::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/http.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pair: HTTP; protocol
single: HTTP; http.client (standard module)

.. index:: module: urllib.request
.. index:: pair: module; urllib.request

--------------

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/internet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/marshal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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::

Expand Down
4 changes: 2 additions & 2 deletions Doc/library/pdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/posix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pwd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pyexpat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/runpy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/shelve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

**Source code:** :source:`Lib/shelve.py`

.. index:: module: pickle
.. index:: pair: module; pickle

--------------

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 0056369

Please sign in to comment.