From 631bfe602f20c7d0e34b79be604c6040f8691c75 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 27 May 2005 10:43:55 +0000 Subject: [PATCH] SF bug #1209671: dict.popitem documentation should mention empty dict case --- Doc/lib/libstdtypes.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index fd5861428d3..7ebdc63e951 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}