]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34123: Fix missed documentation update for dict.popitem(). (GH-8292) (GH#8307)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 17 Jul 2018 02:08:13 +0000 (19:08 -0700)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Tue, 17 Jul 2018 02:08:13 +0000 (19:08 -0700)
Doc/library/stdtypes.rst

index 786837a23c4238f9a56c9ce9013c5b96b3ab38f5..a0c7ba3f15f54a185dbd3dc9d380324f04fe17e8 100644 (file)
@@ -4201,12 +4201,18 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
 
    .. method:: popitem()
 
-      Remove and return an arbitrary ``(key, value)`` pair from the dictionary.
+      Remove and return a ``(key, value)`` pair from the dictionary.
+      Pairs are returned in :abbr:`LIFO (last-in, first-out)` order.
 
       :meth:`popitem` is useful to destructively iterate over a dictionary, as
       often used in set algorithms.  If the dictionary is empty, calling
       :meth:`popitem` raises a :exc:`KeyError`.
 
+      .. versionchanged:: 3.7
+
+      LIFO order is now guaranteed. In prior versions, :meth:`popitem` would
+      return an arbitrary key/value pair.
+
    .. method:: setdefault(key[, default])
 
       If *key* is in the dictionary, return its value.  If not, insert *key*