]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41584: clarify when the reflected method of a binary arithemtic operator is calle...
authorMiss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 5 Oct 2020 16:52:02 +0000 (09:52 -0700)
committerGitHub <noreply@github.com>
Mon, 5 Oct 2020 16:52:02 +0000 (09:52 -0700)
(cherry picked from commit d02d824e05e2cb86f4df381be18832e76e2c475f)

Co-authored-by: Brett Cannon <brett@python.org>
Doc/reference/datamodel.rst

index 3f053858624164bc6d5efcba90272fb2a15f5e41..924f6d9e2d7e0ca6dac07f80a5570d685bb3c7f3 100644 (file)
@@ -2371,10 +2371,11 @@ left undefined.
 
    .. note::
 
-      If the right operand's type is a subclass of the left operand's type and that
-      subclass provides the reflected method for the operation, this method will be
-      called before the left operand's non-reflected method.  This behavior allows
-      subclasses to override their ancestors' operations.
+      If the right operand's type is a subclass of the left operand's type and
+      that subclass provides a different implementation of the reflected method
+      for the operation, this method will be called before the left operand's
+      non-reflected method. This behavior allows subclasses to override their
+      ancestors' operations.
 
 
 .. method:: object.__iadd__(self, other)
@@ -2773,6 +2774,6 @@ An example of an asynchronous context manager class::
    method—that will instead have the opposite effect of explicitly
    *blocking* such fallback.
 
-.. [#] For operands of the same type, it is assumed that if the non-reflected method
-   (such as :meth:`__add__`) fails the operation is not supported, which is why the
-   reflected method is not called.
+.. [#] For operands of the same type, it is assumed that if the non-reflected
+   method -- such as :meth:`__add__` -- fails then the overall operation is not
+   supported, which is why the reflected method is not called.