]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF bug #1249837: container methods raise KeyError not IndexError
authorRaymond Hettinger <python@rcn.com>
Sun, 21 Aug 2005 11:27:35 +0000 (11:27 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 21 Aug 2005 11:27:35 +0000 (11:27 +0000)
Minor clarification.

Doc/ref/ref3.tex

index 67ffe9ea1ee6867b524f14aba1093d7c395b74ff..d78e546bf59fa9692702df897854b46d90d0d01f 100644 (file)
@@ -1658,6 +1658,8 @@ 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
 (after any special interpretation of negative values),
 \exception{IndexError} should be raised.
+For mapping types, if \var{key} is missing (not in the container),
+\exception{KeyError} should be raised.                     
 \note{\keyword{for} loops expect that an
 \exception{IndexError} will be raised for illegal indexes to allow
 proper detection of the end of the sequence.}