@@ -1001,7 +1001,7 @@ but does not affect the semantics.
1001
1001
1002
1002
The primary must evaluate to a callable object (user-defined functions, built-in
1003
1003
functions, methods of built-in objects, class objects, methods of class
1004
- instances, and all objects having a :meth: `__call__ ` method are callable). All
1004
+ instances, and all objects having a :meth: `~object. __call__ ` method are callable). All
1005
1005
argument expressions are evaluated before the call is attempted. Please refer
1006
1006
to section :ref: `function ` for the syntax of formal :term: `parameter ` lists.
1007
1007
@@ -1159,7 +1159,7 @@ a class instance:
1159
1159
pair: instance; call
1160
1160
single: __call__() (object method)
1161
1161
1162
- The class must define a :meth: `__call__ ` method; the effect is then the same as
1162
+ The class must define a :meth: `~object. __call__ ` method; the effect is then the same as
1163
1163
if that method was called.
1164
1164
1165
1165
@@ -1211,7 +1211,7 @@ Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`.
1211
1211
Raising a negative number to a fractional power results in a :class: `complex `
1212
1212
number. (In earlier versions it raised a :exc: `ValueError `.)
1213
1213
1214
- This operation can be customized using the special :meth: `__pow__ ` method.
1214
+ This operation can be customized using the special :meth: `~object. __pow__ ` method.
1215
1215
1216
1216
.. _unary :
1217
1217
@@ -1234,15 +1234,15 @@ All unary arithmetic and bitwise operations have the same priority:
1234
1234
single: - (minus); unary operator
1235
1235
1236
1236
The unary ``- `` (minus) operator yields the negation of its numeric argument; the
1237
- operation can be overridden with the :meth: `__neg__ ` special method.
1237
+ operation can be overridden with the :meth: `~object. __neg__ ` special method.
1238
1238
1239
1239
.. index ::
1240
1240
single: plus
1241
1241
single: operator; + (plus)
1242
1242
single: + (plus); unary operator
1243
1243
1244
1244
The unary ``+ `` (plus) operator yields its numeric argument unchanged; the
1245
- operation can be overridden with the :meth: `__pos__ ` special method.
1245
+ operation can be overridden with the :meth: `~object. __pos__ ` special method.
1246
1246
1247
1247
.. index ::
1248
1248
single: inversion
@@ -1251,7 +1251,7 @@ operation can be overridden with the :meth:`__pos__` special method.
1251
1251
The unary ``~ `` (invert) operator yields the bitwise inversion of its integer
1252
1252
argument. The bitwise inversion of ``x `` is defined as ``-(x+1) ``. It only
1253
1253
applies to integral numbers or to custom objects that override the
1254
- :meth: `__invert__ ` special method.
1254
+ :meth: `~object. __invert__ ` special method.
1255
1255
1256
1256
1257
1257
@@ -1289,8 +1289,8 @@ the other must be a sequence. In the former case, the numbers are converted to a
1289
1289
common type and then multiplied together. In the latter case, sequence
1290
1290
repetition is performed; a negative repetition factor yields an empty sequence.
1291
1291
1292
- This operation can be customized using the special :meth: `__mul__ ` and
1293
- :meth: `__rmul__ ` methods.
1292
+ This operation can be customized using the special :meth: `~object. __mul__ ` and
1293
+ :meth: `~object. __rmul__ ` methods.
1294
1294
1295
1295
.. index ::
1296
1296
single: matrix multiplication
@@ -1314,8 +1314,8 @@ integer; the result is that of mathematical division with the 'floor' function
1314
1314
applied to the result. Division by zero raises the :exc: `ZeroDivisionError `
1315
1315
exception.
1316
1316
1317
- This operation can be customized using the special :meth: `__truediv__ ` and
1318
- :meth: `__floordiv__ ` methods.
1317
+ This operation can be customized using the special :meth: `~object. __truediv__ ` and
1318
+ :meth: `~object. __floordiv__ ` methods.
1319
1319
1320
1320
.. index ::
1321
1321
single: modulo
@@ -1340,7 +1340,7 @@ also overloaded by string objects to perform old-style string formatting (also
1340
1340
known as interpolation). The syntax for string formatting is described in the
1341
1341
Python Library Reference, section :ref: `old-string-formatting `.
1342
1342
1343
- The *modulo * operation can be customized using the special :meth: `__mod__ ` method.
1343
+ The *modulo * operation can be customized using the special :meth: `~object. __mod__ ` method.
1344
1344
1345
1345
The floor division operator, the modulo operator, and the :func: `divmod `
1346
1346
function are not defined for complex numbers. Instead, convert to a floating
@@ -1356,8 +1356,8 @@ must either both be numbers or both be sequences of the same type. In the
1356
1356
former case, the numbers are converted to a common type and then added together.
1357
1357
In the latter case, the sequences are concatenated.
1358
1358
1359
- This operation can be customized using the special :meth: `__add__ ` and
1360
- :meth: `__radd__ ` methods.
1359
+ This operation can be customized using the special :meth: `~object. __add__ ` and
1360
+ :meth: `~object. __radd__ ` methods.
1361
1361
1362
1362
.. index ::
1363
1363
single: subtraction
@@ -1367,7 +1367,7 @@ This operation can be customized using the special :meth:`__add__` and
1367
1367
The ``- `` (subtraction) operator yields the difference of its arguments. The
1368
1368
numeric arguments are first converted to a common type.
1369
1369
1370
- This operation can be customized using the special :meth: `__sub__ ` method.
1370
+ This operation can be customized using the special :meth: `~object. __sub__ ` method.
1371
1371
1372
1372
1373
1373
.. _shifting :
@@ -1388,8 +1388,8 @@ The shifting operations have lower priority than the arithmetic operations:
1388
1388
These operators accept integers as arguments. They shift the first argument to
1389
1389
the left or right by the number of bits given by the second argument.
1390
1390
1391
- This operation can be customized using the special :meth: `__lshift__ ` and
1392
- :meth: `__rshift__ ` methods.
1391
+ This operation can be customized using the special :meth: `~object. __lshift__ ` and
1392
+ :meth: `~object. __rshift__ ` methods.
1393
1393
1394
1394
.. index :: pair: exception; ValueError
1395
1395
@@ -1416,26 +1416,26 @@ Each of the three bitwise operations has a different priority level:
1416
1416
pair: operator; & (ampersand)
1417
1417
1418
1418
The ``& `` operator yields the bitwise AND of its arguments, which must be
1419
- integers or one of them must be a custom object overriding :meth: `__and__ ` or
1420
- :meth: `__rand__ ` special methods.
1419
+ integers or one of them must be a custom object overriding :meth: `~object. __and__ ` or
1420
+ :meth: `~object. __rand__ ` special methods.
1421
1421
1422
1422
.. index ::
1423
1423
pair: bitwise; xor
1424
1424
pair: exclusive; or
1425
1425
pair: operator; ^ (caret)
1426
1426
1427
1427
The ``^ `` operator yields the bitwise XOR (exclusive OR) of its arguments, which
1428
- must be integers or one of them must be a custom object overriding :meth: `__xor__ ` or
1429
- :meth: `__rxor__ ` special methods.
1428
+ must be integers or one of them must be a custom object overriding :meth: `~object. __xor__ ` or
1429
+ :meth: `~object. __rxor__ ` special methods.
1430
1430
1431
1431
.. index ::
1432
1432
pair: bitwise; or
1433
1433
pair: inclusive; or
1434
1434
pair: operator; | (vertical bar)
1435
1435
1436
1436
The ``| `` operator yields the bitwise (inclusive) OR of its arguments, which
1437
- must be integers or one of them must be a custom object overriding :meth: `__or__ ` or
1438
- :meth: `__ror__ ` special methods.
1437
+ must be integers or one of them must be a custom object overriding :meth: `~object. __or__ ` or
1438
+ :meth: `~object. __ror__ ` special methods.
1439
1439
1440
1440
1441
1441
.. _comparisons :
@@ -1502,7 +1502,7 @@ comparison implementation.
1502
1502
Because all types are (direct or indirect) subtypes of :class: `object `, they
1503
1503
inherit the default comparison behavior from :class: `object `. Types can
1504
1504
customize their comparison behavior by implementing
1505
- :dfn: `rich comparison methods ` like :meth: `__lt__ `, described in
1505
+ :dfn: `rich comparison methods ` like :meth: `~object. __lt__ `, described in
1506
1506
:ref: `customization `.
1507
1507
1508
1508
The default behavior for equality comparison (``== `` and ``!= ``) is based on
@@ -1666,12 +1666,12 @@ substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty strings are
1666
1666
always considered to be a substring of any other string, so ``"" in "abc" `` will
1667
1667
return ``True ``.
1668
1668
1669
- For user-defined classes which define the :meth: `__contains__ ` method, ``x in
1669
+ For user-defined classes which define the :meth: `~object. __contains__ ` method, ``x in
1670
1670
y `` returns ``True `` if ``y.__contains__(x) `` returns a true value, and
1671
1671
``False `` otherwise.
1672
1672
1673
- For user-defined classes which do not define :meth: `__contains__ ` but do define
1674
- :meth: `__iter__ `, ``x in y `` is ``True `` if some value ``z ``, for which the
1673
+ For user-defined classes which do not define :meth: `~object. __contains__ ` but do define
1674
+ :meth: `~object. __iter__ `, ``x in y `` is ``True `` if some value ``z ``, for which the
1675
1675
expression ``x is z or x == z `` is true, is produced while iterating over ``y ``.
1676
1676
If an exception is raised during the iteration, it is as if :keyword: `in ` raised
1677
1677
that exception.
0 commit comments