From: Raymond Hettinger Date: Fri, 27 May 2005 10:45:14 +0000 (+0000) Subject: SF bug #1209671: dict.popitem documentation should mention empty dict case X-Git-Tag: v2.4.2c1~219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8d92d984edcf4466f1a50de1c0c70cd5a9fb7aa;p=thirdparty%2FPython%2Fcpython.git SF bug #1209671: dict.popitem documentation should mention empty dict case --- diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index fd5861428d3d..7ebdc63e9517 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -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}