mirror of https://github.com/python/cpython.git
SF bug #1209671: dict.popitem documentation should mention empty dict case
This commit is contained in:
parent
2f475a7bc8
commit
631bfe602f
|
@ -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}.
|
the dictionary as the value of \var{k}. \var{x} defaults to \var{None}.
|
||||||
|
|
||||||
\item[(6)] \function{popitem()} is useful to destructively iterate
|
\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
|
\item[(7)] \function{fromkeys()} is a class method that returns a
|
||||||
new dictionary. \var{value} defaults to \code{None}. \versionadded{2.3}
|
new dictionary. \var{value} defaults to \code{None}. \versionadded{2.3}
|
||||||
|
|
Loading…
Reference in New Issue