@@ -1171,7 +1171,7 @@ The power operator
1171
1171
1172
1172
.. index ::
1173
1173
pair: power; operation
1174
- operator: **
1174
+ pair: operator; **
1175
1175
1176
1176
The power operator binds more tightly than unary operators on its left; it binds
1177
1177
less tightly than unary operators on its right. The syntax is:
@@ -1232,7 +1232,7 @@ operation can be overridden with the :meth:`__pos__` special method.
1232
1232
1233
1233
.. index ::
1234
1234
single: inversion
1235
- operator: ~ (tilde)
1235
+ pair: operator; ~ (tilde)
1236
1236
1237
1237
The unary ``~ `` (invert) operator yields the bitwise inversion of its integer
1238
1238
argument. The bitwise inversion of ``x `` is defined as ``-(x+1) ``. It only
@@ -1267,7 +1267,7 @@ operators and one for additive operators:
1267
1267
1268
1268
.. index ::
1269
1269
single: multiplication
1270
- operator: * (asterisk)
1270
+ pair: operator; * (asterisk)
1271
1271
1272
1272
The ``* `` (multiplication) operator yields the product of its arguments. The
1273
1273
arguments must either both be numbers, or one argument must be an integer and
@@ -1280,7 +1280,7 @@ This operation can be customized using the special :meth:`__mul__` and
1280
1280
1281
1281
.. index ::
1282
1282
single: matrix multiplication
1283
- operator: @ (at)
1283
+ pair: operator; @ (at)
1284
1284
1285
1285
The ``@ `` (at) operator is intended to be used for matrix multiplication. No
1286
1286
builtin Python types implement this operator.
@@ -1290,8 +1290,8 @@ builtin Python types implement this operator.
1290
1290
.. index ::
1291
1291
exception: ZeroDivisionError
1292
1292
single: division
1293
- operator: / (slash)
1294
- operator: //
1293
+ pair: operator; / (slash)
1294
+ pair: operator; //
1295
1295
1296
1296
The ``/ `` (division) and ``// `` (floor division) operators yield the quotient of
1297
1297
their arguments. The numeric arguments are first converted to a common type.
@@ -1305,7 +1305,7 @@ This operation can be customized using the special :meth:`__truediv__` and
1305
1305
1306
1306
.. index ::
1307
1307
single: modulo
1308
- operator: % (percent)
1308
+ pair: operator; % (percent)
1309
1309
1310
1310
The ``% `` (modulo) operator yields the remainder from the division of the first
1311
1311
argument by the second. The numeric arguments are first converted to a common
@@ -1363,8 +1363,8 @@ Shifting operations
1363
1363
1364
1364
.. index ::
1365
1365
pair: shifting; operation
1366
- operator: <<
1367
- operator: >>
1366
+ pair: operator; <<
1367
+ pair: operator; >>
1368
1368
1369
1369
The shifting operations have lower priority than the arithmetic operations:
1370
1370
@@ -1399,7 +1399,7 @@ Each of the three bitwise operations has a different priority level:
1399
1399
1400
1400
.. index ::
1401
1401
pair: bitwise; and
1402
- operator: & (ampersand)
1402
+ pair: operator; & (ampersand)
1403
1403
1404
1404
The ``& `` operator yields the bitwise AND of its arguments, which must be
1405
1405
integers or one of them must be a custom object overriding :meth: `__and__ ` or
@@ -1408,7 +1408,7 @@ integers or one of them must be a custom object overriding :meth:`__and__` or
1408
1408
.. index ::
1409
1409
pair: bitwise; xor
1410
1410
pair: exclusive; or
1411
- operator: ^ (caret)
1411
+ pair: operator; ^ (caret)
1412
1412
1413
1413
The ``^ `` operator yields the bitwise XOR (exclusive OR) of its arguments, which
1414
1414
must be integers or one of them must be a custom object overriding :meth: `__xor__ ` or
@@ -1417,7 +1417,7 @@ must be integers or one of them must be a custom object overriding :meth:`__xor_
1417
1417
.. index ::
1418
1418
pair: bitwise; or
1419
1419
pair: inclusive; or
1420
- operator: | (vertical bar)
1420
+ pair: operator; | (vertical bar)
1421
1421
1422
1422
The ``| `` operator yields the bitwise (inclusive) OR of its arguments, which
1423
1423
must be integers or one of them must be a custom object overriding :meth: `__or__ ` or
@@ -1432,12 +1432,12 @@ Comparisons
1432
1432
.. index ::
1433
1433
single: comparison
1434
1434
pair: C; language
1435
- operator: < (less)
1436
- operator: > (greater)
1437
- operator: <=
1438
- operator: >=
1439
- operator: ==
1440
- operator: !=
1435
+ pair: operator; < (less)
1436
+ pair: operator; > (greater)
1437
+ pair: operator; <=
1438
+ pair: operator; >=
1439
+ pair: operator; ==
1440
+ pair: operator; !=
1441
1441
1442
1442
Unlike C, all comparison operations in Python have the same priority, which is
1443
1443
lower than that of any arithmetic, shifting or bitwise operation. Also unlike
@@ -1669,17 +1669,17 @@ raises the :exc:`IndexError` exception. (If any other exception is raised, it i
1669
1669
if :keyword: `in ` raised that exception).
1670
1670
1671
1671
.. index ::
1672
- operator: in
1673
- operator: not in
1672
+ pair: operator; in
1673
+ pair: operator; not in
1674
1674
pair: membership; test
1675
1675
object: sequence
1676
1676
1677
1677
The operator :keyword: `not in ` is defined to have the inverse truth value of
1678
1678
:keyword: `in `.
1679
1679
1680
1680
.. index ::
1681
- operator: is
1682
- operator: is not
1681
+ pair: operator; is
1682
+ pair: operator; is not
1683
1683
pair: identity; test
1684
1684
1685
1685
@@ -1719,17 +1719,17 @@ control flow statements, the following values are interpreted as false:
1719
1719
other values are interpreted as true. User-defined objects can customize their
1720
1720
truth value by providing a :meth: `__bool__ ` method.
1721
1721
1722
- .. index :: operator: not
1722
+ .. index :: pair: operator; not
1723
1723
1724
1724
The operator :keyword: `not ` yields ``True `` if its argument is false, ``False ``
1725
1725
otherwise.
1726
1726
1727
- .. index :: operator: and
1727
+ .. index :: pair: operator; and
1728
1728
1729
1729
The expression ``x and y `` first evaluates *x *; if *x * is false, its value is
1730
1730
returned; otherwise, *y * is evaluated and the resulting value is returned.
1731
1731
1732
- .. index :: operator: or
1732
+ .. index :: pair: operator; or
1733
1733
1734
1734
The expression ``x or y `` first evaluates *x *; if *x * is true, its value is
1735
1735
returned; otherwise, *y * is evaluated and the resulting value is returned.
0 commit comments