[Python-checkins] bpo-34123: Fix missed documentation update for dict.popitem(). (GH-8292) (GH#8307)

Raymond Hettinger webhook-mailer at python.org
Mon Jul 16 22:08:22 EDT 2018


https://github.com/python/cpython/commit/bfa8a358e2cec40484c4655138ca3c6b10f8462a
commit: bfa8a358e2cec40484c4655138ca3c6b10f8462a
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Raymond Hettinger <rhettinger at users.noreply.github.com>
date: 2018-07-16T19:08:13-07:00
summary:

bpo-34123: Fix missed documentation update for dict.popitem(). (GH-8292) (GH#8307)

files:
M Doc/library/stdtypes.rst

diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 786837a23c42..a0c7ba3f15f5 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -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*



More information about the Python-checkins mailing list