Skip to content

Commit 6ab4636

Browse files
authored
GH-97950: Use new-style index directive ('object') (#104158)
* Uncomment object removal in pairindextypes * Use new-style index directive ('object') - C API * Use new-style index directive ('object') - Library * Use new-style index directive ('object') - Reference * Use new-style index directive ('object') - Tutorial
1 parent b0ce2db commit 6ab4636

31 files changed

+143
-143
lines changed

Doc/c-api/bytearray.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Byte Array Objects
66
------------------
77

8-
.. index:: object: bytearray
8+
.. index:: pair: object; bytearray
99

1010

1111
.. c:type:: PyByteArrayObject

Doc/c-api/bytes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Bytes Objects
88
These functions raise :exc:`TypeError` when expecting a bytes parameter and
99
called with a non-bytes parameter.
1010

11-
.. index:: object: bytes
11+
.. index:: pair: object; bytes
1212

1313

1414
.. c:type:: PyBytesObject

Doc/c-api/capsule.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Capsules
66
--------
77

8-
.. index:: object: Capsule
8+
.. index:: pair: object; Capsule
99

1010
Refer to :ref:`using-capsules` for more information on using these objects.
1111

Doc/c-api/complex.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Complex Number Objects
66
----------------------
77

8-
.. index:: object: complex number
8+
.. index:: pair: object; complex number
99

1010
Python's complex number objects are implemented as two distinct types when
1111
viewed from the C API: one is the Python object exposed to Python programs, and

Doc/c-api/concrete.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This section describes Python type objects and the singleton object ``None``.
4040
Numeric Objects
4141
===============
4242

43-
.. index:: object: numeric
43+
.. index:: pair: object; numeric
4444

4545
.. toctree::
4646

@@ -55,7 +55,7 @@ Numeric Objects
5555
Sequence Objects
5656
================
5757

58-
.. index:: object: sequence
58+
.. index:: pair: object; sequence
5959

6060
Generic operations on sequence objects were discussed in the previous chapter;
6161
this section deals with the specific kinds of sequence objects that are
@@ -77,7 +77,7 @@ intrinsic to the Python language.
7777
Container Objects
7878
=================
7979

80-
.. index:: object: mapping
80+
.. index:: pair: object; mapping
8181

8282
.. toctree::
8383

Doc/c-api/dict.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Dictionary Objects
66
------------------
77

8-
.. index:: object: dictionary
8+
.. index:: pair: object; dictionary
99

1010

1111
.. c:type:: PyDictObject

Doc/c-api/file.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
File Objects
66
------------
77

8-
.. index:: object: file
8+
.. index:: pair: object; file
99

1010
These APIs are a minimal emulation of the Python 2 C API for built-in file
1111
objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support

Doc/c-api/float.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Floating Point Objects
66
----------------------
77

8-
.. index:: object: floating point
8+
.. index:: pair: object; floating point
99

1010

1111
.. c:type:: PyFloatObject

Doc/c-api/function.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Function Objects
66
----------------
77

8-
.. index:: object: function
8+
.. index:: pair: object; function
99

1010
There are a few functions specific to Python functions.
1111

Doc/c-api/intro.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ complete listing.
261261
Objects, Types and Reference Counts
262262
===================================
263263

264-
.. index:: object: type
264+
.. index:: pair: object; type
265265

266266
Most Python/C API functions have one or more arguments as well as a return value
267267
of type :c:expr:`PyObject*`. This type is a pointer to an opaque data type

Doc/c-api/list.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
List Objects
66
------------
77

8-
.. index:: object: list
8+
.. index:: pair: object; list
99

1010

1111
.. c:type:: PyListObject

Doc/c-api/long.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Integer Objects
66
---------------
77

8-
.. index:: object: long integer
9-
object: integer
8+
.. index:: pair: object; long integer
9+
pair: object; integer
1010

1111
All integers are implemented as "long" integer objects of arbitrary size.
1212

Doc/c-api/memoryview.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.. _memoryview-objects:
44

55
.. index::
6-
object: memoryview
6+
pair: object; memoryview
77

88
MemoryView objects
99
------------------

Doc/c-api/method.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Instance Method Objects
66
-----------------------
77

8-
.. index:: object: instancemethod
8+
.. index:: pair: object; instancemethod
99

1010
An instance method is a wrapper for a :c:data:`PyCFunction` and the new way
1111
to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
@@ -47,7 +47,7 @@ to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
4747
Method Objects
4848
--------------
4949
50-
.. index:: object: method
50+
.. index:: pair: object; method
5151
5252
Methods are bound function objects. Methods are always bound to an instance of
5353
a user-defined class. Unbound methods (methods bound to a class object) are

Doc/c-api/module.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Module Objects
66
--------------
77

8-
.. index:: object: module
8+
.. index:: pair: object; module
99

1010

1111
.. c:var:: PyTypeObject PyModule_Type

Doc/c-api/none.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The ``None`` Object
66
-------------------
77

8-
.. index:: object: None
8+
.. index:: pair: object; None
99

1010
Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in the
1111
Python/C API. Since ``None`` is a singleton, testing for object identity (using

Doc/c-api/set.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Set Objects
99

1010

1111
.. index::
12-
object: set
13-
object: frozenset
12+
pair: object; set
13+
pair: object; frozenset
1414

1515
This section details the public API for :class:`set` and :class:`frozenset`
1616
objects. Any functionality not listed below is best accessed using either

Doc/c-api/tuple.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Tuple Objects
66
-------------
77

8-
.. index:: object: tuple
8+
.. index:: pair: object; tuple
99

1010

1111
.. c:type:: PyTupleObject

Doc/c-api/type.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Type Objects
66
------------
77

8-
.. index:: object: type
8+
.. index:: pair: object; type
99

1010

1111
.. c:type:: PyTypeObject

Doc/library/functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ are always available. They are listed here in alphabetical order.
18301830
.. class:: type(object)
18311831
type(name, bases, dict, **kwds)
18321832
1833-
.. index:: object: type
1833+
.. index:: pair: object; type
18341834

18351835
With one argument, return the type of an *object*. The return value is a
18361836
type object and generally the same object as returned by

Doc/library/socket.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ all modern Unix systems, Windows, MacOS, and probably additional platforms.
1919

2020
.. include:: ../includes/wasm-notavail.rst
2121

22-
.. index:: object: socket
22+
.. index:: pair: object; socket
2323

2424
The Python interface is a straightforward transliteration of the Unix system
2525
call and library interface for sockets to Python's object-oriented style: the

Doc/library/stdtypes.rst

+25-25
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex`
205205
================================================================
206206

207207
.. index::
208-
object: numeric
209-
object: Boolean
210-
object: integer
211-
object: floating point
212-
object: complex number
208+
pair: object; numeric
209+
pair: object; Boolean
210+
pair: object; integer
211+
pair: object; floating point
212+
pair: object; complex number
213213
pair: C; language
214214

215215
There are three distinct numeric types: :dfn:`integers`, :dfn:`floating
@@ -927,7 +927,7 @@ described in dedicated sections.
927927
Common Sequence Operations
928928
--------------------------
929929

930-
.. index:: object: sequence
930+
.. index:: pair: object; sequence
931931

932932
The operations in the following table are supported by most sequence types,
933933
both mutable and immutable. The :class:`collections.abc.Sequence` ABC is
@@ -1112,7 +1112,7 @@ Immutable Sequence Types
11121112

11131113
.. index::
11141114
triple: immutable; sequence; types
1115-
object: tuple
1115+
pair: object; tuple
11161116
builtin: hash
11171117

11181118
The only operation that immutable sequence types generally implement that is
@@ -1134,8 +1134,8 @@ Mutable Sequence Types
11341134

11351135
.. index::
11361136
triple: mutable; sequence; types
1137-
object: list
1138-
object: bytearray
1137+
pair: object; list
1138+
pair: object; bytearray
11391139

11401140
The operations in the following table are defined on mutable sequence types.
11411141
The :class:`collections.abc.MutableSequence` ABC is provided to make it
@@ -1252,7 +1252,7 @@ Notes:
12521252
Lists
12531253
-----
12541254

1255-
.. index:: object: list
1255+
.. index:: pair: object; list
12561256

12571257
Lists are mutable sequences, typically used to store collections of
12581258
homogeneous items (where the precise degree of similarity will vary by
@@ -1331,7 +1331,7 @@ application).
13311331
Tuples
13321332
------
13331333

1334-
.. index:: object: tuple
1334+
.. index:: pair: object; tuple
13351335

13361336
Tuples are immutable sequences, typically used to store collections of
13371337
heterogeneous data (such as the 2-tuples produced by the :func:`enumerate`
@@ -1375,7 +1375,7 @@ choice than a simple tuple object.
13751375
Ranges
13761376
------
13771377

1378-
.. index:: object: range
1378+
.. index:: pair: object; range
13791379

13801380
The :class:`range` type represents an immutable sequence of numbers and is
13811381
commonly used for looping a specific number of times in :keyword:`for`
@@ -1500,7 +1500,7 @@ objects that compare equal might have different :attr:`~range.start`,
15001500
.. index::
15011501
single: string; text sequence type
15021502
single: str (built-in class); (see also string)
1503-
object: string
1503+
pair: object; string
15041504

15051505
.. _textseq:
15061506

@@ -1534,7 +1534,7 @@ Since there is no separate "character" type, indexing a string produces
15341534
strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``.
15351535

15361536
.. index::
1537-
object: io.StringIO
1537+
pair: object; io.StringIO
15381538

15391539
There is also no mutable string type, but :meth:`str.join` or
15401540
:class:`io.StringIO` can be used to efficiently construct strings from
@@ -2508,9 +2508,9 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
25082508
=================================================================================
25092509

25102510
.. index::
2511-
object: bytes
2512-
object: bytearray
2513-
object: memoryview
2511+
pair: object; bytes
2512+
pair: object; bytearray
2513+
pair: object; memoryview
25142514
pair: module; array
25152515

25162516
The core built-in types for manipulating binary data are :class:`bytes` and
@@ -2526,7 +2526,7 @@ The :mod:`array` module supports efficient storage of basic data types like
25262526
Bytes Objects
25272527
-------------
25282528

2529-
.. index:: object: bytes
2529+
.. index:: pair: object; bytes
25302530

25312531
Bytes objects are immutable sequences of single bytes. Since many major
25322532
binary protocols are based on the ASCII text encoding, bytes objects offer
@@ -2633,7 +2633,7 @@ always convert a bytes object into a list of integers using ``list(b)``.
26332633
Bytearray Objects
26342634
-----------------
26352635

2636-
.. index:: object: bytearray
2636+
.. index:: pair: object; bytearray
26372637

26382638
:class:`bytearray` objects are a mutable counterpart to :class:`bytes`
26392639
objects.
@@ -4212,7 +4212,7 @@ copying.
42124212
Set Types --- :class:`set`, :class:`frozenset`
42134213
==============================================
42144214

4215-
.. index:: object: set
4215+
.. index:: pair: object; set
42164216

42174217
A :dfn:`set` object is an unordered collection of distinct :term:`hashable` objects.
42184218
Common uses include membership testing, removing duplicates from a sequence, and
@@ -4414,8 +4414,8 @@ Mapping Types --- :class:`dict`
44144414
===============================
44154415

44164416
.. index::
4417-
object: mapping
4418-
object: dictionary
4417+
pair: object; mapping
4418+
pair: object; dictionary
44194419
triple: operations on; mapping; types
44204420
triple: operations on; dictionary; type
44214421
statement: del
@@ -4889,7 +4889,7 @@ Generic Alias Type
48894889
------------------
48904890

48914891
.. index::
4892-
object: GenericAlias
4892+
pair: object; GenericAlias
48934893
pair: Generic; Alias
48944894

48954895
``GenericAlias`` objects are generally created by
@@ -5144,7 +5144,7 @@ Union Type
51445144
----------
51455145

51465146
.. index::
5147-
object: Union
5147+
pair: object; Union
51485148
pair: union; type
51495149

51505150
A union object holds the value of the ``|`` (bitwise or) operation on
@@ -5301,7 +5301,7 @@ See :ref:`function` for more information.
53015301
Methods
53025302
-------
53035303

5304-
.. index:: object: method
5304+
.. index:: pair: object; method
53055305

53065306
Methods are functions that are called using the attribute notation. There are
53075307
two flavors: built-in methods (such as :meth:`append` on lists) and class

Doc/library/sys.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ always available.
444444
object <traceback-objects>` which typically encapsulates the call
445445
stack at the point where the exception last occurred.
446446

447-
.. index:: object: traceback
447+
.. index:: pair: object; traceback
448448

449449
If no exception is being handled anywhere on the stack, this function
450450
return a tuple containing three ``None`` values.

0 commit comments

Comments
 (0)