mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
Backport docstring improvements to OrderedDict. (GH-3470)
This commit is contained in:
parent
d6c397bf77
commit
2a0f7c34c3
2 changed files with 8 additions and 6 deletions
|
@ -155,9 +155,9 @@ class OrderedDict(dict):
|
|||
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')
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue