@@ -2439,7 +2439,7 @@ left undefined.
2439
2439
(``+ ``, ``- ``, ``* ``, ``@ ``, ``/ ``, ``// ``, ``% ``, :func: `divmod `,
2440
2440
:func: `pow `, ``** ``, ``<< ``, ``>> ``, ``& ``, ``^ ``, ``| ``). For instance, to
2441
2441
evaluate the expression ``x + y ``, where *x * is an instance of a class that
2442
- has an :meth: `__add__ ` method, ``x .__add__(y) `` is called. The
2442
+ has an :meth: `__add__ ` method, ``type(x) .__add__(x, y) `` is called. The
2443
2443
:meth: `__divmod__ ` method should be the equivalent to using
2444
2444
:meth: `__floordiv__ ` and :meth: `__mod__ `; it should not be related to
2445
2445
:meth: `__truediv__ `. Note that :meth: `__pow__ ` should be defined to accept
@@ -2475,8 +2475,9 @@ left undefined.
2475
2475
(swapped) operands. These functions are only called if the left operand does
2476
2476
not support the corresponding operation [# ]_ and the operands are of different
2477
2477
types. [# ]_ For instance, to evaluate the expression ``x - y ``, where *y * is
2478
- an instance of a class that has an :meth: `__rsub__ ` method, ``y.__rsub__(x) ``
2479
- is called if ``x.__sub__(y) `` returns *NotImplemented *.
2478
+ an instance of a class that has an :meth: `__rsub__ ` method,
2479
+ ``type(y).__rsub__(y, x) `` is called if ``type(x).__sub__(x, y) `` returns
2480
+ *NotImplemented *.
2480
2481
2481
2482
.. index :: builtin: pow
2482
2483
0 commit comments