Skip to content

Commit 0056369

Browse files
authored
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (#104154)
1 parent 8f94c94 commit 0056369

33 files changed

+65
-69
lines changed

Doc/c-api/exceptions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ Signal Handling
543543
.. c:function:: int PyErr_CheckSignals()
544544
545545
.. index::
546-
module: signal
546+
pair: module; signal
547547
single: SIGINT
548548
single: KeyboardInterrupt (built-in exception)
549549
@@ -574,7 +574,7 @@ Signal Handling
574574
.. c:function:: void PyErr_SetInterrupt()
575575
576576
.. index::
577-
module: signal
577+
pair: module; signal
578578
single: SIGINT
579579
single: KeyboardInterrupt (built-in exception)
580580
@@ -589,7 +589,7 @@ Signal Handling
589589
.. c:function:: int PyErr_SetInterruptEx(int signum)
590590
591591
.. index::
592-
module: signal
592+
pair: module; signal
593593
single: KeyboardInterrupt (built-in exception)
594594
595595
Simulate the effect of a signal arriving. The next time

Doc/c-api/init.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ Initializing and finalizing the interpreter
233233
single: PyEval_InitThreads()
234234
single: modules (in module sys)
235235
single: path (in module sys)
236-
module: builtins
237-
module: __main__
238-
module: sys
236+
pair: module; builtins
237+
pair: module; __main__
238+
pair: module; sys
239239
triple: module; search; path
240240
single: PySys_SetArgv()
241241
single: PySys_SetArgvEx()
@@ -942,7 +942,7 @@ code, or when embedding the Python interpreter:
942942
943943
.. deprecated:: 3.9
944944
945-
.. index:: module: _thread
945+
.. index:: pair: module; _thread
946946
947947
948948
.. c:function:: int PyEval_ThreadsInitialized()
@@ -1385,9 +1385,9 @@ function. You can create and destroy them using the following functions:
13851385
.. c:function:: PyThreadState* Py_NewInterpreter()
13861386
13871387
.. index::
1388-
module: builtins
1389-
module: __main__
1390-
module: sys
1388+
pair: module; builtins
1389+
pair: module; __main__
1390+
pair: module; sys
13911391
single: stdout (in module sys)
13921392
single: stderr (in module sys)
13931393
single: stdin (in module sys)

Doc/c-api/intro.rst

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ In addition to these methods, lock objects can also be used via the
206206

207207
**Caveats:**
208208

209-
.. index:: module: signal
209+
.. index:: pair: module; signal
210210

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

Doc/library/binascii.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ are always available. They are listed here in alphabetical order.
13391339
single: I/O control; buffering
13401340
single: binary mode
13411341
single: text mode
1342-
module: sys
1342+
pair: module; sys
13431343

13441344
See also the file handling modules, such as :mod:`fileinput`, :mod:`io`
13451345
(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.
19791979

19801980
.. index::
19811981
statement: import
1982-
module: imp
1982+
pair: module; builtins
19831983

19841984
.. note::
19851985

Doc/library/http.client.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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.
@@ -476,7 +476,7 @@ The :mod:`locale` module defines the following exception and functions:
476476

477477
.. data:: LC_CTYPE
478478

479-
.. index:: module: string
479+
.. index:: pair: module; string
480480

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

Doc/library/marshal.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
11851185

11861186
.. function:: openpty()
11871187

1188-
.. index:: module: pty
1188+
.. index:: pair: module; pty
11891189

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

2710-
.. index:: module: stat
2710+
.. index:: pair: module; stat
27112711

27122712
Example::
27132713

Doc/library/pdb.rst

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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
@@ -96,7 +96,7 @@ The :mod:`runpy` module provides two functions:
9696
.. function:: run_path(path_name, init_globals=None, run_name=None)
9797

9898
.. index::
99-
module: __main__
99+
pair: module; __main__
100100

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

Doc/library/shelve.rst

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ to sockets.
18291829
.. method:: socket.setsockopt(level, optname, None, optlen: int)
18301830
:noindex:
18311831

1832-
.. index:: module: struct
1832+
.. index:: pair: module; struct
18331833

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

Doc/library/stdtypes.rst

Lines changed: 4 additions & 4 deletions
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)
@@ -1561,7 +1561,7 @@ String Methods
15611561
--------------
15621562

15631563
.. index::
1564-
module: re
1564+
pair: module; re
15651565

15661566
Strings implement all of the :ref:`common <typesseq-common>` sequence
15671567
operations, along with the additional methods described below.
@@ -2467,7 +2467,7 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
24672467
object: bytes
24682468
object: bytearray
24692469
object: memoryview
2470-
module: array
2470+
pair: module; array
24712471

24722472
The core built-in types for manipulating binary data are :class:`bytes` and
24732473
:class:`bytearray`. They are supported by :class:`memoryview` which uses
@@ -5325,7 +5325,7 @@ Type Objects
53255325

53265326
.. index::
53275327
builtin: type
5328-
module: types
5328+
pair: module; types
53295329

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

Doc/reference/compound_stmts.rst

Lines changed: 1 addition & 1 deletion
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)