]> granicus.if.org Git - python/commitdiff
SF bug #1209671: dict.popitem documentation should mention empty dict case
authorRaymond Hettinger <python@rcn.com>
Fri, 27 May 2005 10:43:55 +0000 (10:43 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 27 May 2005 10:43:55 +0000 (10:43 +0000)
Doc/lib/libstdtypes.tex

index fd5861428d3d2118c35c0fbaea22f34427484a6a..7ebdc63e95178fadb59ea3a0879845be9d07ddbd 100644 (file)
@@ -1398,7 +1398,8 @@ that if \var{k} is missing, \var{x} is both returned and inserted into
 the dictionary as the value of \var{k}. \var{x} defaults to \var{None}.
 
 \item[(6)] \function{popitem()} is useful to destructively iterate
-over a dictionary, as often used in set algorithms.
+over a dictionary, as often used in set algorithms.  If the dictionary
+is empty, calling \function{popitem()} raises a \exception{KeyError}.
 
 \item[(7)] \function{fromkeys()} is a class method that returns a
 new dictionary. \var{value} defaults to \code{None}.  \versionadded{2.3}