]> granicus.if.org Git - python/commitdiff
Note that __getitem__() may receive a slice object as the index;
authorFred Drake <fdrake@acm.org>
Thu, 21 Sep 2000 05:28:26 +0000 (05:28 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 21 Sep 2000 05:28:26 +0000 (05:28 +0000)
reported by Detlef Lannert <lannert@uni-duesseldorf.de>.

Doc/ref/ref3.tex

index 53e919fdd90adc4e663a96b949fb7cedd3eb9e48..6648d27d6a7d66fb57dc59dac9d634a4c3f1dbee 100644 (file)
@@ -1095,8 +1095,9 @@ returns zero is considered to be false in a Boolean context.
 
 \begin{methoddesc}[mapping object]{__getitem__}{self, key}
 Called to implement evaluation of \code{\var{self}[\var{key}]}.
-For a sequence types, the accepted keys should be integers.  Note that
-the special interpretation of negative indices (if the class wishes to
+For sequence types, the accepted keys should be integers and slice
+objects.\obindex{slice}  Note that
+the special interpretation of negative indexes (if the class wishes to
 emulate a sequence type) is up to the \method{__getitem__()} method.
 If \var{key} is of an inappropriate type, \exception{TypeError} may be
 raised; if of a value outside the set of indexes for the sequence