diff options
| author | Inada Naoki <songofacandy@gmail.com> | 2019-07-02 20:32:43 +0900 |
|---|---|---|
| committer | Ćukasz Langa <lukasz@langa.pl> | 2019-07-02 13:32:43 +0200 |
| commit | d4c664736e43284405100d98d516fa269a647461 (patch) | |
| tree | 684439e09b0c16f9a1d75b6ff98e5f09c3b88006 /Objects/clinic | |
| parent | 518dc94e423398f7b0b5fd7bd5b84f138618e68e (diff) | |
| download | cpython-git-d4c664736e43284405100d98d516fa269a647461.tar.gz | |
Stop using Argument Clinic for dict_pop (GH-13935)
Diffstat (limited to 'Objects/clinic')
| -rw-r--r-- | Objects/clinic/dictobject.c.h | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h index b87244d873..8d54933308 100644 --- a/Objects/clinic/dictobject.c.h +++ b/Objects/clinic/dictobject.c.h @@ -116,42 +116,6 @@ exit: return return_value; } -PyDoc_STRVAR(dict_pop__doc__, -"pop($self, key, default=None, /)\n" -"--\n" -"\n" -"Remove specified key and return the corresponding value.\n" -"\n" -"If key is not found, default is returned if given, otherwise KeyError is raised"); - -#define DICT_POP_METHODDEF \ - {"pop", (PyCFunction)(void(*)(void))dict_pop, METH_FASTCALL, dict_pop__doc__}, - -static PyObject * -dict_pop_impl(PyDictObject *self, PyObject *key, PyObject *default_value); - -static PyObject * -dict_pop(PyDictObject *self, PyObject *const *args, Py_ssize_t nargs) -{ - PyObject *return_value = NULL; - PyObject *key; - PyObject *default_value = NULL; - - if (!_PyArg_CheckPositional("pop", nargs, 1, 2)) { - goto exit; - } - key = args[0]; - if (nargs < 2) { - goto skip_optional; - } - default_value = args[1]; -skip_optional: - return_value = dict_pop_impl(self, key, default_value); - -exit: - return return_value; -} - PyDoc_STRVAR(dict_popitem__doc__, "popitem($self, /)\n" "--\n" @@ -190,4 +154,4 @@ dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored)) { return dict___reversed___impl(self); } -/*[clinic end generated code: output=0fd5cafc61a51d3c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=676532dcc941d399 input=a9049054013a1b77]*/ |
