Skip to content

Commit c463796

Browse files
[3.11] GH-97950: Use new-style index directive ('object') (GH-104158) (#104159)
GH-97950: Use new-style index directive ('object') (GH-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 (cherry picked from commit 6ab4636) Co-authored-by: Adam Turner <[email protected]>
1 parent 693ef48 commit c463796

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
@@ -1822,7 +1822,7 @@ are always available. They are listed here in alphabetical order.
18221822
.. class:: type(object)
18231823
type(name, bases, dict, **kwds)
18241824
1825-
.. index:: object: type
1825+
.. index:: pair: object; type
18261826

18271827
With one argument, return the type of an *object*. The return value is a
18281828
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
@@ -888,7 +888,7 @@ described in dedicated sections.
888888
Common Sequence Operations
889889
--------------------------
890890

891-
.. index:: object: sequence
891+
.. index:: pair: object; sequence
892892

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

10741074
.. index::
10751075
triple: immutable; sequence; types
1076-
object: tuple
1076+
pair: object; tuple
10771077
builtin: hash
10781078

10791079
The only operation that immutable sequence types generally implement that is
@@ -1095,8 +1095,8 @@ Mutable Sequence Types
10951095

10961096
.. index::
10971097
triple: mutable; sequence; types
1098-
object: list
1099-
object: bytearray
1098+
pair: object; list
1099+
pair: object; bytearray
11001100

11011101
The operations in the following table are defined on mutable sequence types.
11021102
The :class:`collections.abc.MutableSequence` ABC is provided to make it
@@ -1213,7 +1213,7 @@ Notes:
12131213
Lists
12141214
-----
12151215

1216-
.. index:: object: list
1216+
.. index:: pair: object; list
12171217

12181218
Lists are mutable sequences, typically used to store collections of
12191219
homogeneous items (where the precise degree of similarity will vary by
@@ -1292,7 +1292,7 @@ application).
12921292
Tuples
12931293
------
12941294

1295-
.. index:: object: tuple
1295+
.. index:: pair: object; tuple
12961296

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

1339-
.. index:: object: range
1339+
.. index:: pair: object; range
13401340

13411341
The :class:`range` type represents an immutable sequence of numbers and is
13421342
commonly used for looping a specific number of times in :keyword:`for`
@@ -1461,7 +1461,7 @@ objects that compare equal might have different :attr:`~range.start`,
14611461
.. index::
14621462
single: string; text sequence type
14631463
single: str (built-in class); (see also string)
1464-
object: string
1464+
pair: object; string
14651465

14661466
.. _textseq:
14671467

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

14971497
.. index::
1498-
object: io.StringIO
1498+
pair: object; io.StringIO
14991499

15001500
There is also no mutable string type, but :meth:`str.join` or
15011501
:class:`io.StringIO` can be used to efficiently construct strings from
@@ -2464,9 +2464,9 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
24642464
=================================================================================
24652465

24662466
.. index::
2467-
object: bytes
2468-
object: bytearray
2469-
object: memoryview
2467+
pair: object; bytes
2468+
pair: object; bytearray
2469+
pair: object; memoryview
24702470
pair: module; array
24712471

24722472
The core built-in types for manipulating binary data are :class:`bytes` and
@@ -2482,7 +2482,7 @@ The :mod:`array` module supports efficient storage of basic data types like
24822482
Bytes Objects
24832483
-------------
24842484

2485-
.. index:: object: bytes
2485+
.. index:: pair: object; bytes
24862486

24872487
Bytes objects are immutable sequences of single bytes. Since many major
24882488
binary protocols are based on the ASCII text encoding, bytes objects offer
@@ -2589,7 +2589,7 @@ always convert a bytes object into a list of integers using ``list(b)``.
25892589
Bytearray Objects
25902590
-----------------
25912591

2592-
.. index:: object: bytearray
2592+
.. index:: pair: object; bytearray
25932593

25942594
:class:`bytearray` objects are a mutable counterpart to :class:`bytes`
25952595
objects.
@@ -4165,7 +4165,7 @@ copying.
41654165
Set Types --- :class:`set`, :class:`frozenset`
41664166
==============================================
41674167

4168-
.. index:: object: set
4168+
.. index:: pair: object; set
41694169

41704170
A :dfn:`set` object is an unordered collection of distinct :term:`hashable` objects.
41714171
Common uses include membership testing, removing duplicates from a sequence, and
@@ -4367,8 +4367,8 @@ Mapping Types --- :class:`dict`
43674367
===============================
43684368

43694369
.. index::
4370-
object: mapping
4371-
object: dictionary
4370+
pair: object; mapping
4371+
pair: object; dictionary
43724372
triple: operations on; mapping; types
43734373
triple: operations on; dictionary; type
43744374
statement: del
@@ -4836,7 +4836,7 @@ Generic Alias Type
48364836
------------------
48374837

48384838
.. index::
4839-
object: GenericAlias
4839+
pair: object; GenericAlias
48404840
pair: Generic; Alias
48414841

48424842
``GenericAlias`` objects are generally created by
@@ -5091,7 +5091,7 @@ Union Type
50915091
----------
50925092

50935093
.. index::
5094-
object: Union
5094+
pair: object; Union
50955095
pair: union; type
50965096

50975097
A union object holds the value of the ``|`` (bitwise or) operation on
@@ -5248,7 +5248,7 @@ See :ref:`function` for more information.
52485248
Methods
52495249
-------
52505250

5251-
.. index:: object: method
5251+
.. index:: pair: object; method
52525252

52535253
Methods are functions that are called using the attribute notation. There are
52545254
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
@@ -440,7 +440,7 @@ always available.
440440
object <traceback-objects>` which typically encapsulates the call
441441
stack at the point where the exception last occurred.
442442

443-
.. index:: object: traceback
443+
.. index:: pair: object; traceback
444444

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

0 commit comments

Comments
 (0)