@@ -205,11 +205,11 @@ Numeric Types --- :class:`int`, :class:`float`, :class:`complex`
205
205
================================================================
206
206
207
207
.. 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
213
213
pair: C; language
214
214
215
215
There are three distinct numeric types: :dfn: `integers `, :dfn: `floating
@@ -927,7 +927,7 @@ described in dedicated sections.
927
927
Common Sequence Operations
928
928
--------------------------
929
929
930
- .. index :: object: sequence
930
+ .. index :: pair: object; sequence
931
931
932
932
The operations in the following table are supported by most sequence types,
933
933
both mutable and immutable. The :class: `collections.abc.Sequence ` ABC is
@@ -1112,7 +1112,7 @@ Immutable Sequence Types
1112
1112
1113
1113
.. index ::
1114
1114
triple: immutable; sequence; types
1115
- object: tuple
1115
+ pair: object; tuple
1116
1116
builtin: hash
1117
1117
1118
1118
The only operation that immutable sequence types generally implement that is
@@ -1134,8 +1134,8 @@ Mutable Sequence Types
1134
1134
1135
1135
.. index ::
1136
1136
triple: mutable; sequence; types
1137
- object: list
1138
- object: bytearray
1137
+ pair: object; list
1138
+ pair: object; bytearray
1139
1139
1140
1140
The operations in the following table are defined on mutable sequence types.
1141
1141
The :class: `collections.abc.MutableSequence ` ABC is provided to make it
@@ -1252,7 +1252,7 @@ Notes:
1252
1252
Lists
1253
1253
-----
1254
1254
1255
- .. index :: object: list
1255
+ .. index :: pair: object; list
1256
1256
1257
1257
Lists are mutable sequences, typically used to store collections of
1258
1258
homogeneous items (where the precise degree of similarity will vary by
@@ -1331,7 +1331,7 @@ application).
1331
1331
Tuples
1332
1332
------
1333
1333
1334
- .. index :: object: tuple
1334
+ .. index :: pair: object; tuple
1335
1335
1336
1336
Tuples are immutable sequences, typically used to store collections of
1337
1337
heterogeneous data (such as the 2-tuples produced by the :func: `enumerate `
@@ -1375,7 +1375,7 @@ choice than a simple tuple object.
1375
1375
Ranges
1376
1376
------
1377
1377
1378
- .. index :: object: range
1378
+ .. index :: pair: object; range
1379
1379
1380
1380
The :class: `range ` type represents an immutable sequence of numbers and is
1381
1381
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`,
1500
1500
.. index ::
1501
1501
single: string; text sequence type
1502
1502
single: str (built-in class); (see also string)
1503
- object: string
1503
+ pair: object; string
1504
1504
1505
1505
.. _textseq :
1506
1506
@@ -1534,7 +1534,7 @@ Since there is no separate "character" type, indexing a string produces
1534
1534
strings of length 1. That is, for a non-empty string *s *, ``s[0] == s[0:1] ``.
1535
1535
1536
1536
.. index ::
1537
- object: io.StringIO
1537
+ pair: object; io.StringIO
1538
1538
1539
1539
There is also no mutable string type, but :meth: `str.join ` or
1540
1540
:class: `io.StringIO ` can be used to efficiently construct strings from
@@ -2508,9 +2508,9 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
2508
2508
=================================================================================
2509
2509
2510
2510
.. index ::
2511
- object: bytes
2512
- object: bytearray
2513
- object: memoryview
2511
+ pair: object; bytes
2512
+ pair: object; bytearray
2513
+ pair: object; memoryview
2514
2514
pair: module; array
2515
2515
2516
2516
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
2526
2526
Bytes Objects
2527
2527
-------------
2528
2528
2529
- .. index :: object: bytes
2529
+ .. index :: pair: object; bytes
2530
2530
2531
2531
Bytes objects are immutable sequences of single bytes. Since many major
2532
2532
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)``.
2633
2633
Bytearray Objects
2634
2634
-----------------
2635
2635
2636
- .. index :: object: bytearray
2636
+ .. index :: pair: object; bytearray
2637
2637
2638
2638
:class: `bytearray ` objects are a mutable counterpart to :class: `bytes `
2639
2639
objects.
@@ -4212,7 +4212,7 @@ copying.
4212
4212
Set Types --- :class: `set `, :class: `frozenset `
4213
4213
==============================================
4214
4214
4215
- .. index :: object: set
4215
+ .. index :: pair: object; set
4216
4216
4217
4217
A :dfn: `set ` object is an unordered collection of distinct :term: `hashable ` objects.
4218
4218
Common uses include membership testing, removing duplicates from a sequence, and
@@ -4414,8 +4414,8 @@ Mapping Types --- :class:`dict`
4414
4414
===============================
4415
4415
4416
4416
.. index ::
4417
- object: mapping
4418
- object: dictionary
4417
+ pair: object; mapping
4418
+ pair: object; dictionary
4419
4419
triple: operations on; mapping; types
4420
4420
triple: operations on; dictionary; type
4421
4421
statement: del
@@ -4889,7 +4889,7 @@ Generic Alias Type
4889
4889
------------------
4890
4890
4891
4891
.. index ::
4892
- object: GenericAlias
4892
+ pair: object; GenericAlias
4893
4893
pair: Generic; Alias
4894
4894
4895
4895
``GenericAlias `` objects are generally created by
@@ -5144,7 +5144,7 @@ Union Type
5144
5144
----------
5145
5145
5146
5146
.. index ::
5147
- object: Union
5147
+ pair: object; Union
5148
5148
pair: union; type
5149
5149
5150
5150
A union object holds the value of the ``| `` (bitwise or) operation on
@@ -5301,7 +5301,7 @@ See :ref:`function` for more information.
5301
5301
Methods
5302
5302
-------
5303
5303
5304
- .. index :: object: method
5304
+ .. index :: pair: object; method
5305
5305
5306
5306
Methods are functions that are called using the attribute notation. There are
5307
5307
two flavors: built-in methods (such as :meth: `append ` on lists) and class
0 commit comments