@@ -1714,6 +1714,7 @@ left undefined.
17141714.. method :: object.__add__(self, other)
17151715 object.__sub__(self, other)
17161716 object.__mul__(self, other)
1717+ object.__truediv__(self, other)
17171718 object.__floordiv__(self, other)
17181719 object.__mod__(self, other)
17191720 object.__divmod__(self, other)
@@ -1730,33 +1731,22 @@ left undefined.
17301731 builtin: pow
17311732
17321733 These methods are called to implement the binary arithmetic operations (``+ ``,
1733- ``- ``, ``* ``, ``// ``, ``% ``, :func: `divmod `, :func: `pow `, ``** ``, ``<< ``,
1734+ ``- ``, ``* ``, ``/ ``, `` / / ``, ``% ``, :func: `divmod `, :func: `pow `, ``** ``, ``<< ``,
17341735 ``>> ``, ``& ``, ``^ ``, ``| ``). For instance, to evaluate the expression
17351736 ``x + y ``, where *x * is an instance of a class that has an :meth: `__add__ `
17361737 method, ``x.__add__(y) `` is called. The :meth: `__divmod__ ` method should be the
17371738 equivalent to using :meth: `__floordiv__ ` and :meth: `__mod__ `; it should not be
1738- related to :meth: `__truediv__ ` (described below) . Note that :meth: `__pow__ `
1739- should be defined to accept an optional third argument if the ternary version of
1740- the built-in :func: `pow ` function is to be supported.
1739+ related to :meth: `__truediv__ `. Note that :meth: `__pow__ ` should be defined
1740+ to accept an optional third argument if the ternary version of the built-in
1741+ :func: `pow ` function is to be supported.
17411742
17421743 If one of those methods does not support the operation with the supplied
17431744 arguments, it should return ``NotImplemented ``.
17441745
17451746
1746- .. method :: object.__div__(self, other)
1747- object.__truediv__(self, other)
1748-
1749- The division operator (``/ ``) is implemented by these methods. The
1750- :meth: `__truediv__ ` method is used when ``__future__.division `` is in effect,
1751- otherwise :meth: `__div__ ` is used. If only one of these two methods is defined,
1752- the object will not support division in the alternate context; :exc: `TypeError `
1753- will be raised instead.
1754-
1755-
17561747.. method :: object.__radd__(self, other)
17571748 object.__rsub__(self, other)
17581749 object.__rmul__(self, other)
1759- object.__rdiv__(self, other)
17601750 object.__rtruediv__(self, other)
17611751 object.__rfloordiv__(self, other)
17621752 object.__rmod__(self, other)
@@ -1773,13 +1763,13 @@ left undefined.
17731763 builtin: pow
17741764
17751765 These methods are called to implement the binary arithmetic operations (``+ ``,
1776- ``- ``, ``* ``, ``/ ``, ``% ``, :func: `divmod `, :func: `pow `, ``** ``, `` << ``, `` >> ``,
1777- ``& ``, ``^ ``, ``| ``) with reflected (swapped) operands. These functions are
1778- only called if the left operand does not support the corresponding operation and
1779- the operands are of different types. [# ]_ For instance, to evaluate the
1780- expression ``x - y ``, where *y * is an instance of a class that has an
1781- :meth: `__rsub__ ` method, ``y.__rsub__(x) `` is called if `` x.__sub__(y) `` returns
1782- *NotImplemented *.
1766+ ``- ``, ``* ``, ``/ ``, ``// ``, `` % ``, :func: `divmod `, :func: `pow `, ``** ``,
1767+ ``<< ``, `` >> ``, `` & ``, ``^ ``, ``| ``) with reflected (swapped) operands.
1768+ These functions are only called if the left operand does not support the
1769+ corresponding operation and the operands are of different types. [# ]_ For
1770+ instance, to evaluate the expression ``x - y ``, where *y * is an instance of
1771+ a class that has an :meth: `__rsub__ ` method, ``y.__rsub__(x) `` is called if
1772+ `` x.__sub__(y) `` returns *NotImplemented *.
17831773
17841774 .. index :: builtin: pow
17851775
@@ -1797,7 +1787,6 @@ left undefined.
17971787.. method :: object.__iadd__(self, other)
17981788 object.__isub__(self, other)
17991789 object.__imul__(self, other)
1800- object.__idiv__(self, other)
18011790 object.__itruediv__(self, other)
18021791 object.__ifloordiv__(self, other)
18031792 object.__imod__(self, other)
0 commit comments