]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bug #1462278: small fix in documentation of __op__ vs __rop__ methods
authorGeorg Brandl <georg@python.org>
Sat, 1 Apr 2006 07:23:12 +0000 (07:23 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 1 Apr 2006 07:23:12 +0000 (07:23 +0000)
 (backport from rev. 43521)

Doc/ref/ref3.tex

index 5fcb51ebb93ec16985eda2e11917cf97d05d6430..ed3579aec78ec1ee5022d190c9264830bf5f702a 100644 (file)
@@ -2005,14 +2005,15 @@ exception is raised.  But see the following exception:
 \item
 
 Exception to the previous item: if the left operand is an instance of
-a built-in type or a new-style class, and the right operand is an
-instance of a proper subclass of that type or class, the right
-operand's \method{__rop__()} method is tried \emph{before} the left
-operand's \method{__op__()} method.  This is done so that a subclass can
-completely override binary operators.  Otherwise, the left operand's
-__op__ method would always accept the right operand: when an instance
-of a given class is expected, an instance of a subclass of that class
-is always acceptable.
+a built-in type or a new-style class, and the right operand is an instance
+of a proper subclass of that type or class and overrides the base's
+\method{__rop__()} method, the right operand's \method{__rop__()} method
+is tried \emph{before} the left operand's \method{__op__()} method.
+
+This is done so that a subclass can completely override binary operators.
+Otherwise, the left operand's \method{__op__()} method would always
+accept the right operand: when an instance of a given class is expected,
+an instance of a subclass of that class is always acceptable.
 
 \item