Kaydet (Commit) 2a0f7c34 authored tarafından Henk-Jaap Wagenaar's avatar Henk-Jaap Wagenaar Kaydeden (comit) Mariatta

Backport docstring improvements to OrderedDict. (GH-3470)

üst d6c397bf
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment