@@ -1160,7 +1160,7 @@ The power operator
1160
1160
1161
1161
.. index ::
1162
1162
pair: power; operation
1163
- operator: **
1163
+ pair: operator; **
1164
1164
1165
1165
The power operator binds more tightly than unary operators on its left; it binds
1166
1166
less tightly than unary operators on its right. The syntax is:
@@ -1221,7 +1221,7 @@ operation can be overridden with the :meth:`__pos__` special method.
1221
1221
1222
1222
.. index ::
1223
1223
single: inversion
1224
- operator: ~ (tilde)
1224
+ pair: operator; ~ (tilde)
1225
1225
1226
1226
The unary ``~ `` (invert) operator yields the bitwise inversion of its integer
1227
1227
argument. The bitwise inversion of ``x `` is defined as ``-(x+1) ``. It only
@@ -1256,7 +1256,7 @@ operators and one for additive operators:
1256
1256
1257
1257
.. index ::
1258
1258
single: multiplication
1259
- operator: * (asterisk)
1259
+ pair: operator; * (asterisk)
1260
1260
1261
1261
The ``* `` (multiplication) operator yields the product of its arguments. The
1262
1262
arguments must either both be numbers, or one argument must be an integer and
@@ -1269,7 +1269,7 @@ This operation can be customized using the special :meth:`__mul__` and
1269
1269
1270
1270
.. index ::
1271
1271
single: matrix multiplication
1272
- operator: @ (at)
1272
+ pair: operator; @ (at)
1273
1273
1274
1274
The ``@ `` (at) operator is intended to be used for matrix multiplication. No
1275
1275
builtin Python types implement this operator.
@@ -1279,8 +1279,8 @@ builtin Python types implement this operator.
1279
1279
.. index ::
1280
1280
exception: ZeroDivisionError
1281
1281
single: division
1282
- operator: / (slash)
1283
- operator: //
1282
+ pair: operator; / (slash)
1283
+ pair: operator; //
1284
1284
1285
1285
The ``/ `` (division) and ``// `` (floor division) operators yield the quotient of
1286
1286
their arguments. The numeric arguments are first converted to a common type.
@@ -1294,7 +1294,7 @@ This operation can be customized using the special :meth:`__truediv__` and
1294
1294
1295
1295
.. index ::
1296
1296
single: modulo
1297
- operator: % (percent)
1297
+ pair: operator; % (percent)
1298
1298
1299
1299
The ``% `` (modulo) operator yields the remainder from the division of the first
1300
1300
argument by the second. The numeric arguments are first converted to a common
@@ -1352,8 +1352,8 @@ Shifting operations
1352
1352
1353
1353
.. index ::
1354
1354
pair: shifting; operation
1355
- operator: <<
1356
- operator: >>
1355
+ pair: operator; <<
1356
+ pair: operator; >>
1357
1357
1358
1358
The shifting operations have lower priority than the arithmetic operations:
1359
1359
@@ -1388,7 +1388,7 @@ Each of the three bitwise operations has a different priority level:
1388
1388
1389
1389
.. index ::
1390
1390
pair: bitwise; and
1391
- operator: & (ampersand)
1391
+ pair: operator; & (ampersand)
1392
1392
1393
1393
The ``& `` operator yields the bitwise AND of its arguments, which must be
1394
1394
integers or one of them must be a custom object overriding :meth: `__and__ ` or
@@ -1397,7 +1397,7 @@ integers or one of them must be a custom object overriding :meth:`__and__` or
1397
1397
.. index ::
1398
1398
pair: bitwise; xor
1399
1399
pair: exclusive; or
1400
- operator: ^ (caret)
1400
+ pair: operator; ^ (caret)
1401
1401
1402
1402
The ``^ `` operator yields the bitwise XOR (exclusive OR) of its arguments, which
1403
1403
must be integers or one of them must be a custom object overriding :meth: `__xor__ ` or
@@ -1406,7 +1406,7 @@ must be integers or one of them must be a custom object overriding :meth:`__xor_
1406
1406
.. index ::
1407
1407
pair: bitwise; or
1408
1408
pair: inclusive; or
1409
- operator: | (vertical bar)
1409
+ pair: operator; | (vertical bar)
1410
1410
1411
1411
The ``| `` operator yields the bitwise (inclusive) OR of its arguments, which
1412
1412
must be integers or one of them must be a custom object overriding :meth: `__or__ ` or
@@ -1421,12 +1421,12 @@ Comparisons
1421
1421
.. index ::
1422
1422
single: comparison
1423
1423
pair: C; language
1424
- operator: < (less)
1425
- operator: > (greater)
1426
- operator: <=
1427
- operator: >=
1428
- operator: ==
1429
- operator: !=
1424
+ pair: operator; < (less)
1425
+ pair: operator; > (greater)
1426
+ pair: operator; <=
1427
+ pair: operator; >=
1428
+ pair: operator; ==
1429
+ pair: operator; !=
1430
1430
1431
1431
Unlike C, all comparison operations in Python have the same priority, which is
1432
1432
lower than that of any arithmetic, shifting or bitwise operation. Also unlike
@@ -1658,17 +1658,17 @@ raises the :exc:`IndexError` exception. (If any other exception is raised, it i
1658
1658
if :keyword: `in ` raised that exception).
1659
1659
1660
1660
.. index ::
1661
- operator: in
1662
- operator: not in
1661
+ pair: operator; in
1662
+ pair: operator; not in
1663
1663
pair: membership; test
1664
1664
object: sequence
1665
1665
1666
1666
The operator :keyword: `not in ` is defined to have the inverse truth value of
1667
1667
:keyword: `in `.
1668
1668
1669
1669
.. index ::
1670
- operator: is
1671
- operator: is not
1670
+ pair: operator; is
1671
+ pair: operator; is not
1672
1672
pair: identity; test
1673
1673
1674
1674
@@ -1708,17 +1708,17 @@ control flow statements, the following values are interpreted as false:
1708
1708
other values are interpreted as true. User-defined objects can customize their
1709
1709
truth value by providing a :meth: `__bool__ ` method.
1710
1710
1711
- .. index :: operator: not
1711
+ .. index :: pair: operator; not
1712
1712
1713
1713
The operator :keyword: `not ` yields ``True `` if its argument is false, ``False ``
1714
1714
otherwise.
1715
1715
1716
- .. index :: operator: and
1716
+ .. index :: pair: operator; and
1717
1717
1718
1718
The expression ``x and y `` first evaluates *x *; if *x * is false, its value is
1719
1719
returned; otherwise, *y * is evaluated and the resulting value is returned.
1720
1720
1721
- .. index :: operator: or
1721
+ .. index :: pair: operator; or
1722
1722
1723
1723
The expression ``x or y `` first evaluates *x *; if *x * is true, its value is
1724
1724
returned; otherwise, *y * is evaluated and the resulting value is returned.
0 commit comments