From dc39bc64d415793ebddfc5774e1a79f03936f5f5 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 12 May 2003 13:50:41 +0000 Subject: [PATCH] Add a specific mention of the term "operator overloading" and add an index entry. Suggested to python-docs. --- Doc/ref/ref3.tex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex index 3553c09d2ab9..feff2a985efe 100644 --- a/Doc/ref/ref3.tex +++ b/Doc/ref/ref3.tex @@ -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 -- 2.47.3