diff options
author | RĂ©mi Lapeyre <remi.lapeyre@henki.fr> | 2018-11-06 00:38:54 (GMT) |
---|---|---|
committer | INADA Naoki <methane@users.noreply.github.com> | 2018-11-06 00:38:54 (GMT) |
commit | 6531bf6309c8fda1954060a0fb5ea930b1efb656 (patch) | |
tree | 64debbc908a8d0dbd043d3114a536a750bb70339 /Objects/clinic | |
parent | 16c8a53490a22bd4fcde2efaf4694dd06ded882b (diff) | |
download | cpython-6531bf6309c8fda1954060a0fb5ea930b1efb656.zip cpython-6531bf6309c8fda1954060a0fb5ea930b1efb656.tar.gz cpython-6531bf6309c8fda1954060a0fb5ea930b1efb656.tar.bz2 |
bpo-33462: Add __reversed__ to dict and dict views (GH-6827)
Diffstat (limited to 'Objects/clinic')
-rw-r--r-- | Objects/clinic/dictobject.c.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index 58677cd..4f4c9fa 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -103,4 +103,22 @@ dict_setdefault(PyDictObject *self, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=d7508c5091609a23 input=a9049054013a1b77]*/ + +PyDoc_STRVAR(dict___reversed____doc__, +"__reversed__($self, /)\n" +"--\n" +"\n" +"Return a reverse iterator over the dict keys."); + +#define DICT___REVERSED___METHODDEF \ + {"__reversed__", (PyCFunction)dict___reversed__, METH_NOARGS, dict___reversed____doc__}, + +static PyObject * +dict___reversed___impl(PyDictObject *self); + +static PyObject * +dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored)) +{ + return dict___reversed___impl(self); +} +/*[clinic end generated code: output=b9923851cbd9213a input=a9049054013a1b77]*/ |