SF bug #1209671: dict.popitem documentation should mention empty dict case

This commit is contained in:
Raymond Hettinger 2005-05-27 10:43:55 +00:00
parent 2f475a7bc8
commit 631bfe602f
1 changed files with 2 additions and 1 deletions

View 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}