Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def clear(self):
dict.clear(self)

def popitem(self, last=True):
'''od.popitem() -> (k, v), return and remove a (key, value) pair.
Pairs are returned in LIFO order if last is true or FIFO order if false.
'''Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.
'''
if not self:
raise KeyError('dictionary is empty')
Expand Down
10 changes: 6 additions & 4 deletions Objects/odictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,10 +1154,12 @@ _odict_popkey(PyObject *od, PyObject *key, PyObject *failobj)
/* popitem() */

PyDoc_STRVAR(odict_popitem__doc__,
"od.popitem() -> (k, v), return and remove a (key, value) pair.\n\
Pairs are returned in LIFO order if last is true or FIFO order if false.\n\
\n\
");
"popitem($self, /, last=True)\n"
"--\n"
"\n"
"Remove and return a (key, value) pair from the dictionary.\n"
"\n"
"Pairs are returned in LIFO order if last is true or FIFO order if false.");

static PyObject *
odict_popitem(PyObject *od, PyObject *args, PyObject *kwargs)
Expand Down