]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a specific mention of the term "operator overloading" and add an
authorFred Drake <fdrake@acm.org>
Mon, 12 May 2003 13:50:41 +0000 (13:50 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 12 May 2003 13:50:41 +0000 (13:50 +0000)
index entry.  Suggested to python-docs.

Doc/ref/ref3.tex

index 3553c09d2ab98d95327ebd89d6f1a6b290cdb11c..feff2a985efe5e47fc39b0d24f5d15a47adf646c 100644 (file)
@@ -894,7 +894,10 @@ Special read-only attributes: \member{start} is the lower bound;
 
 A class can implement certain operations that are invoked by special
 syntax (such as arithmetic operations or subscripting and slicing) by
-defining methods with special names.  For instance, if a class defines
+defining methods with special names.\indexii{operator}{overloading}
+This is Python's approach to \dfn{operator overloading}, allowing
+classes to define their own behavior with respect to language
+operators.  For instance, if a class defines
 a method named \method{__getitem__()}, and \code{x} is an instance of
 this class, then \code{x[i]} is equivalent to
 \code{x.__getitem__(i)}.  Except where mentioned, attempts to execute