]> granicus.if.org Git - python/commitdiff
Closes SF patch: 552468.
authorRaymond Hettinger <python@rcn.com>
Sun, 12 May 2002 03:09:25 +0000 (03:09 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 12 May 2002 03:09:25 +0000 (03:09 +0000)
Type class unification invalidated the statement:  x.__getitem__[i] is not equivalent to x[i].

Doc/ref/ref3.tex

index 3e5b2c3d58b55e565105b7609e456ac1bcc025a4..f1fecf0e5d6c920348ba4a388a39bf2f789d340e 100644 (file)
@@ -897,10 +897,8 @@ syntax (such as arithmetic operations or subscripting and slicing) by
 defining methods with special names.  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)}.  (The reverse is not true --- if \code{x} is
-a list object, \code{x.__getitem__(i)} is not equivalent to
-\code{x[i]}.)  Except where mentioned, attempts to execute an
-operation raise an exception when no appropriate method is defined.
+\code{x.__getitem__(i)}.  Except where mentioned, attempts to execute
+an operation raise an exception when no appropriate method is defined.
 \withsubitem{(mapping object method)}{\ttindex{__getitem__()}}
 
 When implementing a class that emulates any built-in type, it is