@@ -994,7 +994,7 @@ but does not affect the semantics.
994
994
995
995
The primary must evaluate to a callable object (user-defined functions, built-in
996
996
functions, methods of built-in objects, class objects, methods of class
997
- instances, and all objects having a :meth: `__call__ ` method are callable). All
997
+ instances, and all objects having a :meth: `~object. __call__ ` method are callable). All
998
998
argument expressions are evaluated before the call is attempted. Please refer
999
999
to section :ref: `function ` for the syntax of formal :term: `parameter ` lists.
1000
1000
@@ -1152,7 +1152,7 @@ a class instance:
1152
1152
pair: instance; call
1153
1153
single: __call__() (object method)
1154
1154
1155
- The class must define a :meth: `__call__ ` method; the effect is then the same as
1155
+ The class must define a :meth: `~object. __call__ ` method; the effect is then the same as
1156
1156
if that method was called.
1157
1157
1158
1158
@@ -1204,7 +1204,7 @@ Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`.
1204
1204
Raising a negative number to a fractional power results in a :class: `complex `
1205
1205
number. (In earlier versions it raised a :exc: `ValueError `.)
1206
1206
1207
- This operation can be customized using the special :meth: `__pow__ ` method.
1207
+ This operation can be customized using the special :meth: `~object. __pow__ ` method.
1208
1208
1209
1209
.. _unary :
1210
1210
@@ -1227,15 +1227,15 @@ All unary arithmetic and bitwise operations have the same priority:
1227
1227
single: - (minus); unary operator
1228
1228
1229
1229
The unary ``- `` (minus) operator yields the negation of its numeric argument; the
1230
- operation can be overridden with the :meth: `__neg__ ` special method.
1230
+ operation can be overridden with the :meth: `~object. __neg__ ` special method.
1231
1231
1232
1232
.. index ::
1233
1233
single: plus
1234
1234
single: operator; + (plus)
1235
1235
single: + (plus); unary operator
1236
1236
1237
1237
The unary ``+ `` (plus) operator yields its numeric argument unchanged; the
1238
- operation can be overridden with the :meth: `__pos__ ` special method.
1238
+ operation can be overridden with the :meth: `~object. __pos__ ` special method.
1239
1239
1240
1240
.. index ::
1241
1241
single: inversion
@@ -1244,7 +1244,7 @@ operation can be overridden with the :meth:`__pos__` special method.
1244
1244
The unary ``~ `` (invert) operator yields the bitwise inversion of its integer
1245
1245
argument. The bitwise inversion of ``x `` is defined as ``-(x+1) ``. It only
1246
1246
applies to integral numbers or to custom objects that override the
1247
- :meth: `__invert__ ` special method.
1247
+ :meth: `~object. __invert__ ` special method.
1248
1248
1249
1249
1250
1250
@@ -1282,8 +1282,8 @@ the other must be a sequence. In the former case, the numbers are converted to a
1282
1282
common type and then multiplied together. In the latter case, sequence
1283
1283
repetition is performed; a negative repetition factor yields an empty sequence.
1284
1284
1285
- This operation can be customized using the special :meth: `__mul__ ` and
1286
- :meth: `__rmul__ ` methods.
1285
+ This operation can be customized using the special :meth: `~object. __mul__ ` and
1286
+ :meth: `~object. __rmul__ ` methods.
1287
1287
1288
1288
.. index ::
1289
1289
single: matrix multiplication
@@ -1307,8 +1307,8 @@ integer; the result is that of mathematical division with the 'floor' function
1307
1307
applied to the result. Division by zero raises the :exc: `ZeroDivisionError `
1308
1308
exception.
1309
1309
1310
- This operation can be customized using the special :meth: `__truediv__ ` and
1311
- :meth: `__floordiv__ ` methods.
1310
+ This operation can be customized using the special :meth: `~object. __truediv__ ` and
1311
+ :meth: `~object. __floordiv__ ` methods.
1312
1312
1313
1313
.. index ::
1314
1314
single: modulo
@@ -1333,7 +1333,7 @@ also overloaded by string objects to perform old-style string formatting (also
1333
1333
known as interpolation). The syntax for string formatting is described in the
1334
1334
Python Library Reference, section :ref: `old-string-formatting `.
1335
1335
1336
- The *modulo * operation can be customized using the special :meth: `__mod__ ` method.
1336
+ The *modulo * operation can be customized using the special :meth: `~object. __mod__ ` method.
1337
1337
1338
1338
The floor division operator, the modulo operator, and the :func: `divmod `
1339
1339
function are not defined for complex numbers. Instead, convert to a floating
@@ -1349,8 +1349,8 @@ must either both be numbers or both be sequences of the same type. In the
1349
1349
former case, the numbers are converted to a common type and then added together.
1350
1350
In the latter case, the sequences are concatenated.
1351
1351
1352
- This operation can be customized using the special :meth: `__add__ ` and
1353
- :meth: `__radd__ ` methods.
1352
+ This operation can be customized using the special :meth: `~object. __add__ ` and
1353
+ :meth: `~object. __radd__ ` methods.
1354
1354
1355
1355
.. index ::
1356
1356
single: subtraction
@@ -1360,7 +1360,7 @@ This operation can be customized using the special :meth:`__add__` and
1360
1360
The ``- `` (subtraction) operator yields the difference of its arguments. The
1361
1361
numeric arguments are first converted to a common type.
1362
1362
1363
- This operation can be customized using the special :meth: `__sub__ ` method.
1363
+ This operation can be customized using the special :meth: `~object. __sub__ ` method.
1364
1364
1365
1365
1366
1366
.. _shifting :
@@ -1381,8 +1381,8 @@ The shifting operations have lower priority than the arithmetic operations:
1381
1381
These operators accept integers as arguments. They shift the first argument to
1382
1382
the left or right by the number of bits given by the second argument.
1383
1383
1384
- This operation can be customized using the special :meth: `__lshift__ ` and
1385
- :meth: `__rshift__ ` methods.
1384
+ This operation can be customized using the special :meth: `~object. __lshift__ ` and
1385
+ :meth: `~object. __rshift__ ` methods.
1386
1386
1387
1387
.. index :: pair: exception; ValueError
1388
1388
@@ -1409,26 +1409,26 @@ Each of the three bitwise operations has a different priority level:
1409
1409
pair: operator; & (ampersand)
1410
1410
1411
1411
The ``& `` operator yields the bitwise AND of its arguments, which must be
1412
- integers or one of them must be a custom object overriding :meth: `__and__ ` or
1413
- :meth: `__rand__ ` special methods.
1412
+ integers or one of them must be a custom object overriding :meth: `~object. __and__ ` or
1413
+ :meth: `~object. __rand__ ` special methods.
1414
1414
1415
1415
.. index ::
1416
1416
pair: bitwise; xor
1417
1417
pair: exclusive; or
1418
1418
pair: operator; ^ (caret)
1419
1419
1420
1420
The ``^ `` operator yields the bitwise XOR (exclusive OR) of its arguments, which
1421
- must be integers or one of them must be a custom object overriding :meth: `__xor__ ` or
1422
- :meth: `__rxor__ ` special methods.
1421
+ must be integers or one of them must be a custom object overriding :meth: `~object. __xor__ ` or
1422
+ :meth: `~object. __rxor__ ` special methods.
1423
1423
1424
1424
.. index ::
1425
1425
pair: bitwise; or
1426
1426
pair: inclusive; or
1427
1427
pair: operator; | (vertical bar)
1428
1428
1429
1429
The ``| `` operator yields the bitwise (inclusive) OR of its arguments, which
1430
- must be integers or one of them must be a custom object overriding :meth: `__or__ ` or
1431
- :meth: `__ror__ ` special methods.
1430
+ must be integers or one of them must be a custom object overriding :meth: `~object. __or__ ` or
1431
+ :meth: `~object. __ror__ ` special methods.
1432
1432
1433
1433
1434
1434
.. _comparisons :
@@ -1495,7 +1495,7 @@ comparison implementation.
1495
1495
Because all types are (direct or indirect) subtypes of :class: `object `, they
1496
1496
inherit the default comparison behavior from :class: `object `. Types can
1497
1497
customize their comparison behavior by implementing
1498
- :dfn: `rich comparison methods ` like :meth: `__lt__ `, described in
1498
+ :dfn: `rich comparison methods ` like :meth: `~object. __lt__ `, described in
1499
1499
:ref: `customization `.
1500
1500
1501
1501
The default behavior for equality comparison (``== `` and ``!= ``) is based on
@@ -1659,12 +1659,12 @@ substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty strings are
1659
1659
always considered to be a substring of any other string, so ``"" in "abc" `` will
1660
1660
return ``True ``.
1661
1661
1662
- For user-defined classes which define the :meth: `__contains__ ` method, ``x in
1662
+ For user-defined classes which define the :meth: `~object. __contains__ ` method, ``x in
1663
1663
y `` returns ``True `` if ``y.__contains__(x) `` returns a true value, and
1664
1664
``False `` otherwise.
1665
1665
1666
- For user-defined classes which do not define :meth: `__contains__ ` but do define
1667
- :meth: `__iter__ `, ``x in y `` is ``True `` if some value ``z ``, for which the
1666
+ For user-defined classes which do not define :meth: `~object. __contains__ ` but do define
1667
+ :meth: `~object. __iter__ `, ``x in y `` is ``True `` if some value ``z ``, for which the
1668
1668
expression ``x is z or x == z `` is true, is produced while iterating over ``y ``.
1669
1669
If an exception is raised during the iteration, it is as if :keyword: `in ` raised
1670
1670
that exception.
0 commit comments