Skip to content

Commit d012237

Browse files
authored
GH-97950: Use new-style index directive ('module') (#103996)
* Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference * Use new-style index directive ('module') - Tutorial * Uncomment module removal in pairindextypes * Use new-style index directive ('module') - C API * Use new-style index directive ('module') - Library * Use new-style index directive ('module') - Reference
1 parent cd9a56c commit d012237

33 files changed

+65
-69
lines changed

Doc/c-api/exceptions.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ Signal Handling
602602
.. c:function:: int PyErr_CheckSignals()
603603
604604
.. index::
605-
module: signal
605+
pair: module; signal
606606
single: SIGINT
607607
single: KeyboardInterrupt (built-in exception)
608608
@@ -633,7 +633,7 @@ Signal Handling
633633
.. c:function:: void PyErr_SetInterrupt()
634634
635635
.. index::
636-
module: signal
636+
pair: module; signal
637637
single: SIGINT
638638
single: KeyboardInterrupt (built-in exception)
639639
@@ -648,7 +648,7 @@ Signal Handling
648648
.. c:function:: int PyErr_SetInterruptEx(int signum)
649649
650650
.. index::
651-
module: signal
651+
pair: module; signal
652652
single: KeyboardInterrupt (built-in exception)
653653
654654
Simulate the effect of a signal arriving. The next time

Doc/c-api/init.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ Initializing and finalizing the interpreter
336336
single: PyEval_InitThreads()
337337
single: modules (in module sys)
338338
single: path (in module sys)
339-
module: builtins
340-
module: __main__
341-
module: sys
339+
pair: module; builtins
340+
pair: module; __main__
341+
pair: module; sys
342342
triple: module; search; path
343343
single: PySys_SetArgv()
344344
single: PySys_SetArgvEx()
@@ -1051,7 +1051,7 @@ code, or when embedding the Python interpreter:
10511051
10521052
.. deprecated:: 3.9
10531053
1054-
.. index:: module: _thread
1054+
.. index:: pair: module; _thread
10551055
10561056
10571057
.. c:function:: int PyEval_ThreadsInitialized()
@@ -1494,9 +1494,9 @@ function. You can create and destroy them using the following functions:
14941494
.. c:function:: PyThreadState* Py_NewInterpreter()
14951495
14961496
.. index::
1497-
module: builtins
1498-
module: __main__
1499-
module: sys
1497+
pair: module; builtins
1498+
pair: module; __main__
1499+
pair: module; sys
15001500
single: stdout (in module sys)
15011501
single: stderr (in module sys)
15021502
single: stdin (in module sys)

Doc/c-api/intro.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,9 @@ interpreter can only be used after the interpreter has been initialized.
705705

706706
.. index::
707707
single: Py_Initialize()
708-
module: builtins
709-
module: __main__
710-
module: sys
708+
pair: module; builtins
709+
pair: module; __main__
710+
pair: module; sys
711711
triple: module; search; path
712712
single: path (in module sys)
713713

Doc/library/_thread.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ In addition to these methods, lock objects can also be used via the
208208

209209
**Caveats:**
210210

211-
.. index:: module: signal
211+
.. index:: pair: module; signal
212212

213213
* Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt`
214214
exception will be received by an arbitrary thread. (When the :mod:`signal`

Doc/library/binascii.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
representations.
77

88
.. index::
9-
module: uu
10-
module: base64
9+
pair: module; uu
10+
pair: module; base64
1111

1212
--------------
1313

Doc/library/cmath.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Constants
301301
.. versionadded:: 3.6
302302

303303

304-
.. index:: module: math
304+
.. index:: pair: module; math
305305

306306
Note that the selection of functions is similar, but not identical, to that in
307307
module :mod:`math`. The reason for having two modules is that some users aren't

Doc/library/copy.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Shallow copies of dictionaries can be made using :meth:`dict.copy`, and
6868
of lists by assigning a slice of the entire list, for example,
6969
``copied_list = original_list[:]``.
7070

71-
.. index:: module: pickle
71+
.. index:: pair: module; pickle
7272

7373
Classes can use the same interfaces to control copying that they use to control
7474
pickling. See the description of module :mod:`pickle` for information on these

Doc/library/copyreg.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
**Source code:** :source:`Lib/copyreg.py`
88

99
.. index::
10-
module: pickle
11-
module: copy
10+
pair: module; pickle
11+
pair: module; copy
1212

1313
--------------
1414

Doc/library/exceptions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ The following exceptions are the exceptions that are usually raised.
318318
.. exception:: OSError([arg])
319319
OSError(errno, strerror[, filename[, winerror[, filename2]]])
320320

321-
.. index:: module: errno
321+
.. index:: pair: module; errno
322322

323323
This exception is raised when a system function returns a system-related
324324
error, including I/O failures such as "file not found" or "disk full"

Doc/library/fnmatch.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
.. index:: single: filenames; wildcard expansion
1010

11-
.. index:: module: re
11+
.. index:: pair: module; re
1212

1313
--------------
1414

@@ -38,7 +38,7 @@ special characters used in shell-style wildcards are:
3838
For a literal match, wrap the meta-characters in brackets.
3939
For example, ``'[?]'`` matches the character ``'?'``.
4040

41-
.. index:: module: glob
41+
.. index:: pair: module; glob
4242

4343
Note that the filename separator (``'/'`` on Unix) is *not* special to this
4444
module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses

Doc/library/functions.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ are always available. They are listed here in alphabetical order.
13401340
single: I/O control; buffering
13411341
single: binary mode
13421342
single: text mode
1343-
module: sys
1343+
pair: module; sys
13441344

13451345
See also the file handling modules, such as :mod:`fileinput`, :mod:`io`
13461346
(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`,
@@ -1987,7 +1987,7 @@ are always available. They are listed here in alphabetical order.
19871987

19881988
.. index::
19891989
statement: import
1990-
module: builtins
1990+
pair: module; builtins
19911991

19921992
.. note::
19931993

Doc/library/http.client.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
pair: HTTP; protocol
1111
single: HTTP; http.client (standard module)
1212

13-
.. index:: module: urllib.request
13+
.. index:: pair: module; urllib.request
1414

1515
--------------
1616

Doc/library/internet.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Internet Protocols and Support
99
single: Internet
1010
single: World Wide Web
1111

12-
.. index:: module: socket
12+
.. index:: pair: module; socket
1313

1414
The modules described in this chapter implement internet protocols and support
1515
for related technology. They are all implemented in Python. Most of these

Doc/library/locale.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ functionality. The POSIX locale mechanism allows programmers to deal with
1616
certain cultural issues in an application, without requiring the programmer to
1717
know all the specifics of each country where the software is executed.
1818

19-
.. index:: module: _locale
19+
.. index:: pair: module; _locale
2020

2121
The :mod:`locale` module is implemented on top of the :mod:`_locale` module,
2222
which in turn uses an ANSI C locale implementation if available.
@@ -464,7 +464,7 @@ The :mod:`locale` module defines the following exception and functions:
464464

465465
.. data:: LC_CTYPE
466466

467-
.. index:: module: string
467+
.. index:: pair: module; string
468468

469469
Locale category for the character type functions. Depending on the settings of
470470
this category, the functions of module :mod:`string` dealing with case change

Doc/library/marshal.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ undocumented on purpose; it may change between Python versions (although it
1515
rarely does). [#]_
1616

1717
.. index::
18-
module: pickle
19-
module: shelve
18+
pair: module; pickle
19+
pair: module; shelve
2020

2121
This is not a general "persistence" module. For general persistence and
2222
transfer of Python objects through RPC calls, see the modules :mod:`pickle` and

Doc/library/os.path.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ the :mod:`glob` module.)
159159
On Unix and Windows, return the argument with an initial component of ``~`` or
160160
``~user`` replaced by that *user*'s home directory.
161161

162-
.. index:: module: pwd
162+
.. index:: pair: module; pwd
163163

164164
On Unix, an initial ``~`` is replaced by the environment variable :envvar:`HOME`
165165
if it is set; otherwise the current user's home directory is looked up in the

Doc/library/os.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
12841284

12851285
.. function:: openpty()
12861286

1287-
.. index:: module: pty
1287+
.. index:: pair: module; pty
12881288

12891289
Open a new pseudo-terminal pair. Return a pair of file descriptors
12901290
``(master, slave)`` for the pty and the tty, respectively. The new file
@@ -2890,7 +2890,7 @@ features:
28902890
possible and call :func:`lstat` on the result. This does not apply to
28912891
dangling symlinks or junction points, which will raise the usual exceptions.
28922892

2893-
.. index:: module: stat
2893+
.. index:: pair: module; stat
28942894

28952895
Example::
28962896

Doc/library/pdb.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ supports post-mortem debugging and can be called under program control.
2020

2121
.. index::
2222
single: Pdb (class in pdb)
23-
module: bdb
24-
module: cmd
23+
pair: module; bdb
24+
pair: module; cmd
2525

2626
The debugger is extensible -- it is actually defined as the class :class:`Pdb`.
2727
This is currently undocumented but easily understood by reading the source. The

Doc/library/posix.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This module provides access to operating system functionality that is
1111
standardized by the C Standard and the POSIX standard (a thinly disguised Unix
1212
interface).
1313

14-
.. index:: module: os
14+
.. index:: pair: module; os
1515

1616
**Do not import this module directly.** Instead, import the module :mod:`os`,
1717
which provides a *portable* version of this interface. On Unix, the :mod:`os`

Doc/library/pwd.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ raised if the entry asked for cannot be found.
3939

4040
.. note::
4141

42-
.. index:: module: crypt
42+
.. index:: pair: module; crypt
4343

4444
In traditional Unix the field ``pw_passwd`` usually contains a password
4545
encrypted with a DES derived algorithm (see module :mod:`crypt`). However most

Doc/library/pyexpat.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ can be set to handler functions. When an XML document is then fed to the
3333
parser, the handler functions are called for the character data and markup in
3434
the XML document.
3535

36-
.. index:: module: pyexpat
36+
.. index:: pair: module; pyexpat
3737

3838
This module uses the :mod:`pyexpat` module to provide access to the Expat
3939
parser. Direct use of the :mod:`pyexpat` module is deprecated.

Doc/library/runpy.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The :mod:`runpy` module provides two functions:
3030
.. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=False)
3131

3232
.. index::
33-
module: __main__
33+
pair: module; __main__
3434

3535
Execute the code of the specified module and return the resulting module
3636
globals dictionary. The module's code is first located using the standard
@@ -101,7 +101,7 @@ The :mod:`runpy` module provides two functions:
101101
.. function:: run_path(path_name, init_globals=None, run_name=None)
102102

103103
.. index::
104-
module: __main__
104+
pair: module; __main__
105105

106106
Execute the code at the named filesystem location and return the resulting
107107
module globals dictionary. As with a script name supplied to the CPython

Doc/library/shelve.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

9-
.. index:: module: pickle
9+
.. index:: pair: module; pickle
1010

1111
--------------
1212

@@ -95,8 +95,8 @@ Restrictions
9595
------------
9696

9797
.. index::
98-
module: dbm.ndbm
99-
module: dbm.gnu
98+
pair: module; dbm.ndbm
99+
pair: module; dbm.gnu
100100

101101
* The choice of which database package will be used (such as :mod:`dbm.ndbm` or
102102
:mod:`dbm.gnu`) depends on which interface is available. Therefore it is not

Doc/library/site.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ directory precedes the :file:`foo` directory because :file:`bar.pth` comes
109109
alphabetically before :file:`foo.pth`; and :file:`spam` is omitted because it is
110110
not mentioned in either path configuration file.
111111

112-
.. index:: module: sitecustomize
112+
.. index:: pair: module; sitecustomize
113113

114114
After these path manipulations, an attempt is made to import a module named
115115
: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),
121121
attempted output from :mod:`sitecustomize` is ignored. Any other exception
122122
causes a silent and perhaps mysterious failure of the process.
123123

124-
.. index:: module: usercustomize
124+
.. index:: pair: module; usercustomize
125125

126126
After this, an attempt is made to import a module named :mod:`usercustomize`,
127127
which can perform arbitrary user-specific customizations, if

Doc/library/socket.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ to sockets.
19161916
.. method:: socket.setsockopt(level, optname, None, optlen: int)
19171917
:noindex:
19181918

1919-
.. index:: module: struct
1919+
.. index:: pair: module; struct
19201920

19211921
Set the value of the given socket option (see the Unix manual page
19221922
:manpage:`setsockopt(2)`). The needed symbolic constants are defined in the

Doc/library/stdtypes.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Notes:
330330

331331
(3)
332332
.. index::
333-
module: math
333+
pair: module; math
334334
single: floor() (in module math)
335335
single: ceil() (in module math)
336336
single: trunc() (in module math)
@@ -1600,7 +1600,7 @@ String Methods
16001600
--------------
16011601

16021602
.. index::
1603-
module: re
1603+
pair: module; re
16041604

16051605
Strings implement all of the :ref:`common <typesseq-common>` sequence
16061606
operations, along with the additional methods described below.
@@ -2511,7 +2511,7 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
25112511
object: bytes
25122512
object: bytearray
25132513
object: memoryview
2514-
module: array
2514+
pair: module; array
25152515

25162516
The core built-in types for manipulating binary data are :class:`bytes` and
25172517
:class:`bytearray`. They are supported by :class:`memoryview` which uses
@@ -5378,7 +5378,7 @@ Type Objects
53785378

53795379
.. index::
53805380
builtin: type
5381-
module: types
5381+
pair: module; types
53825382

53835383
Type objects represent the various object types. An object's type is accessed
53845384
by the built-in function :func:`type`. There are no special operations on

Doc/reference/compound_stmts.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ traceback attached to them, they form a reference cycle with the stack frame,
297297
keeping all locals in that frame alive until the next garbage collection occurs.
298298

299299
.. index::
300-
module: sys
300+
pair: module; sys
301301
object: traceback
302302

303303
Before an :keyword:`!except` clause's suite is executed,

0 commit comments

Comments
 (0)