@@ -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
@@ -888,7 +888,7 @@ described in dedicated sections.
888
888
Common Sequence Operations
889
889
--------------------------
890
890
891
- .. index :: object: sequence
891
+ .. index :: pair: object; sequence
892
892
893
893
The operations in the following table are supported by most sequence types,
894
894
both mutable and immutable. The :class: `collections.abc.Sequence ` ABC is
@@ -1073,7 +1073,7 @@ Immutable Sequence Types
1073
1073
1074
1074
.. index ::
1075
1075
triple: immutable; sequence; types
1076
- object: tuple
1076
+ pair: object; tuple
1077
1077
builtin: hash
1078
1078
1079
1079
The only operation that immutable sequence types generally implement that is
@@ -1095,8 +1095,8 @@ Mutable Sequence Types
1095
1095
1096
1096
.. index ::
1097
1097
triple: mutable; sequence; types
1098
- object: list
1099
- object: bytearray
1098
+ pair: object; list
1099
+ pair: object; bytearray
1100
1100
1101
1101
The operations in the following table are defined on mutable sequence types.
1102
1102
The :class: `collections.abc.MutableSequence ` ABC is provided to make it
@@ -1213,7 +1213,7 @@ Notes:
1213
1213
Lists
1214
1214
-----
1215
1215
1216
- .. index :: object: list
1216
+ .. index :: pair: object; list
1217
1217
1218
1218
Lists are mutable sequences, typically used to store collections of
1219
1219
homogeneous items (where the precise degree of similarity will vary by
@@ -1292,7 +1292,7 @@ application).
1292
1292
Tuples
1293
1293
------
1294
1294
1295
- .. index :: object: tuple
1295
+ .. index :: pair: object; tuple
1296
1296
1297
1297
Tuples are immutable sequences, typically used to store collections of
1298
1298
heterogeneous data (such as the 2-tuples produced by the :func: `enumerate `
@@ -1336,7 +1336,7 @@ choice than a simple tuple object.
1336
1336
Ranges
1337
1337
------
1338
1338
1339
- .. index :: object: range
1339
+ .. index :: pair: object; range
1340
1340
1341
1341
The :class: `range ` type represents an immutable sequence of numbers and is
1342
1342
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`,
1461
1461
.. index ::
1462
1462
single: string; text sequence type
1463
1463
single: str (built-in class); (see also string)
1464
- object: string
1464
+ pair: object; string
1465
1465
1466
1466
.. _textseq :
1467
1467
@@ -1495,7 +1495,7 @@ Since there is no separate "character" type, indexing a string produces
1495
1495
strings of length 1. That is, for a non-empty string *s *, ``s[0] == s[0:1] ``.
1496
1496
1497
1497
.. index ::
1498
- object: io.StringIO
1498
+ pair: object; io.StringIO
1499
1499
1500
1500
There is also no mutable string type, but :meth: `str.join ` or
1501
1501
:class: `io.StringIO ` can be used to efficiently construct strings from
@@ -2464,9 +2464,9 @@ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview
2464
2464
=================================================================================
2465
2465
2466
2466
.. index ::
2467
- object: bytes
2468
- object: bytearray
2469
- object: memoryview
2467
+ pair: object; bytes
2468
+ pair: object; bytearray
2469
+ pair: object; memoryview
2470
2470
pair: module; array
2471
2471
2472
2472
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
2482
2482
Bytes Objects
2483
2483
-------------
2484
2484
2485
- .. index :: object: bytes
2485
+ .. index :: pair: object; bytes
2486
2486
2487
2487
Bytes objects are immutable sequences of single bytes. Since many major
2488
2488
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)``.
2589
2589
Bytearray Objects
2590
2590
-----------------
2591
2591
2592
- .. index :: object: bytearray
2592
+ .. index :: pair: object; bytearray
2593
2593
2594
2594
:class: `bytearray ` objects are a mutable counterpart to :class: `bytes `
2595
2595
objects.
@@ -4165,7 +4165,7 @@ copying.
4165
4165
Set Types --- :class: `set `, :class: `frozenset `
4166
4166
==============================================
4167
4167
4168
- .. index :: object: set
4168
+ .. index :: pair: object; set
4169
4169
4170
4170
A :dfn: `set ` object is an unordered collection of distinct :term: `hashable ` objects.
4171
4171
Common uses include membership testing, removing duplicates from a sequence, and
@@ -4367,8 +4367,8 @@ Mapping Types --- :class:`dict`
4367
4367
===============================
4368
4368
4369
4369
.. index ::
4370
- object: mapping
4371
- object: dictionary
4370
+ pair: object; mapping
4371
+ pair: object; dictionary
4372
4372
triple: operations on; mapping; types
4373
4373
triple: operations on; dictionary; type
4374
4374
statement: del
@@ -4836,7 +4836,7 @@ Generic Alias Type
4836
4836
------------------
4837
4837
4838
4838
.. index ::
4839
- object: GenericAlias
4839
+ pair: object; GenericAlias
4840
4840
pair: Generic; Alias
4841
4841
4842
4842
``GenericAlias `` objects are generally created by
@@ -5091,7 +5091,7 @@ Union Type
5091
5091
----------
5092
5092
5093
5093
.. index ::
5094
- object: Union
5094
+ pair: object; Union
5095
5095
pair: union; type
5096
5096
5097
5097
A union object holds the value of the ``| `` (bitwise or) operation on
@@ -5248,7 +5248,7 @@ See :ref:`function` for more information.
5248
5248
Methods
5249
5249
-------
5250
5250
5251
- .. index :: object: method
5251
+ .. index :: pair: object; method
5252
5252
5253
5253
Methods are functions that are called using the attribute notation. There are
5254
5254
two flavors: built-in methods (such as :meth: `append ` on lists) and class
0 commit comments