@@ -1001,7 +1001,7 @@ but does not affect the semantics.
10011001
10021002The primary must evaluate to a callable object (user-defined functions, built-in
10031003functions, 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
10051005argument expressions are evaluated before the call is attempted. Please refer
10061006to section :ref: `function ` for the syntax of formal :term: `parameter ` lists.
10071007
@@ -1159,7 +1159,7 @@ a class instance:
11591159 pair: instance; call
11601160 single: __call__() (object method)
11611161
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
11631163 if that method was called.
11641164
11651165
@@ -1211,7 +1211,7 @@ Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`.
12111211Raising a negative number to a fractional power results in a :class: `complex `
12121212number. (In earlier versions it raised a :exc: `ValueError `.)
12131213
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.
12151215
12161216.. _unary :
12171217
@@ -1234,15 +1234,15 @@ All unary arithmetic and bitwise operations have the same priority:
12341234 single: - (minus); unary operator
12351235
12361236The 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.
12381238
12391239.. index ::
12401240 single: plus
12411241 single: operator; + (plus)
12421242 single: + (plus); unary operator
12431243
12441244The 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.
12461246
12471247.. index ::
12481248 single: inversion
@@ -1251,7 +1251,7 @@ operation can be overridden with the :meth:`__pos__` special method.
12511251The unary ``~ `` (invert) operator yields the bitwise inversion of its integer
12521252argument. The bitwise inversion of ``x `` is defined as ``-(x+1) ``. It only
12531253applies to integral numbers or to custom objects that override the
1254- :meth: `__invert__ ` special method.
1254+ :meth: `~object. __invert__ ` special method.
12551255
12561256
12571257
@@ -1289,8 +1289,8 @@ the other must be a sequence. In the former case, the numbers are converted to a
12891289common type and then multiplied together. In the latter case, sequence
12901290repetition is performed; a negative repetition factor yields an empty sequence.
12911291
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.
12941294
12951295.. index ::
12961296 single: matrix multiplication
@@ -1314,8 +1314,8 @@ integer; the result is that of mathematical division with the 'floor' function
13141314applied to the result. Division by zero raises the :exc: `ZeroDivisionError `
13151315exception.
13161316
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.
13191319
13201320.. index ::
13211321 single: modulo
@@ -1340,7 +1340,7 @@ also overloaded by string objects to perform old-style string formatting (also
13401340known as interpolation). The syntax for string formatting is described in the
13411341Python Library Reference, section :ref: `old-string-formatting `.
13421342
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.
13441344
13451345The floor division operator, the modulo operator, and the :func: `divmod `
13461346function 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
13561356former case, the numbers are converted to a common type and then added together.
13571357In the latter case, the sequences are concatenated.
13581358
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.
13611361
13621362.. index ::
13631363 single: subtraction
@@ -1367,7 +1367,7 @@ This operation can be customized using the special :meth:`__add__` and
13671367The ``- `` (subtraction) operator yields the difference of its arguments. The
13681368numeric arguments are first converted to a common type.
13691369
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.
13711371
13721372
13731373.. _shifting :
@@ -1388,8 +1388,8 @@ The shifting operations have lower priority than the arithmetic operations:
13881388These operators accept integers as arguments. They shift the first argument to
13891389the left or right by the number of bits given by the second argument.
13901390
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.
13931393
13941394.. index :: pair: exception; ValueError
13951395
@@ -1416,26 +1416,26 @@ Each of the three bitwise operations has a different priority level:
14161416 pair: operator; & (ampersand)
14171417
14181418The ``& `` 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.
14211421
14221422.. index ::
14231423 pair: bitwise; xor
14241424 pair: exclusive; or
14251425 pair: operator; ^ (caret)
14261426
14271427The ``^ `` 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.
14301430
14311431.. index ::
14321432 pair: bitwise; or
14331433 pair: inclusive; or
14341434 pair: operator; | (vertical bar)
14351435
14361436The ``| `` 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.
14391439
14401440
14411441.. _comparisons :
@@ -1502,7 +1502,7 @@ comparison implementation.
15021502Because all types are (direct or indirect) subtypes of :class: `object `, they
15031503inherit the default comparison behavior from :class: `object `. Types can
15041504customize 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
15061506:ref: `customization `.
15071507
15081508The 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
16661666always considered to be a substring of any other string, so ``"" in "abc" `` will
16671667return ``True ``.
16681668
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
16701670y `` returns ``True `` if ``y.__contains__(x) `` returns a true value, and
16711671``False `` otherwise.
16721672
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
16751675expression ``x is z or x == z `` is true, is produced while iterating over ``y ``.
16761676If an exception is raised during the iteration, it is as if :keyword: `in ` raised
16771677that exception.
0 commit comments