diff options
author | Fred Drake <fdrake@acm.org> | 2000-09-21 05:28:26 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-09-21 05:28:26 (GMT) |
commit | 31575ce8172d40575be3c3d7a3a4a51d4aaf1a86 (patch) | |
tree | 41144d4e8da909883bcf2995fcaa88f1a5915ba4 /Doc/ref | |
parent | 02997491c1b92141105f433efbaefc2e40ce7a3f (diff) | |
download | cpython-31575ce8172d40575be3c3d7a3a4a51d4aaf1a86.zip cpython-31575ce8172d40575be3c3d7a3a4a51d4aaf1a86.tar.gz cpython-31575ce8172d40575be3c3d7a3a4a51d4aaf1a86.tar.bz2 |
Note that __getitem__() may receive a slice object as the index;
reported by Detlef Lannert <lannert@uni-duesseldorf.de>.
Diffstat (limited to 'Doc/ref')
-rw-r--r-- | Doc/ref/ref3.tex | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex index 53e919f..6648d27 100644 --- a/Doc/ref/ref3.tex +++ b/Doc/ref/ref3.tex @@ -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 |