diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-19 19:00:30 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-19 19:00:30 +0200 |
commit | 48088ee9bae9bd7ceff491cb0bc82e4394c7ec23 (patch) | |
tree | 230eccad66b84e44cc70d2b52c2d0e440953fe63 /Objects/dictobject.c | |
parent | 41baebd8b94c44646bd80c3c0519e757c00940f5 (diff) | |
download | cpython-git-48088ee9bae9bd7ceff491cb0bc82e4394c7ec23.tar.gz |
Issue #29311: Argument Clinic generates reasonable name for the parameter "default".
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index f9414865ad..9ff52c32aa 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -2794,15 +2794,15 @@ dict___contains__(PyDictObject *self, PyObject *key) dict.get key: object - default as failobj: object = None + default: object = None / D.get(key[, default]) -> D[key] if key in D, else default. [clinic start generated code]*/ static PyObject * -dict_get_impl(PyDictObject *self, PyObject *key, PyObject *failobj) -/*[clinic end generated code: output=c4a84a7ddbca9b7b input=7c976a78f258e915]*/ +dict_get_impl(PyDictObject *self, PyObject *key, PyObject *default_value) +/*[clinic end generated code: output=bba707729dee05bf input=e73ab0f028f4b2be]*/ { PyObject *val = NULL; Py_hash_t hash; @@ -2818,7 +2818,7 @@ dict_get_impl(PyDictObject *self, PyObject *key, PyObject *failobj) if (ix == DKIX_ERROR) return NULL; if (ix == DKIX_EMPTY || val == NULL) { - val = failobj; + val = default_value; } Py_INCREF(val); return val; @@ -2912,19 +2912,20 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj) dict.setdefault key: object - default as defaultobj: object = None + default: object = None / D.get(key,default), also set D[key]=default if key not in D. [clinic start generated code]*/ static PyObject * -dict_setdefault_impl(PyDictObject *self, PyObject *key, PyObject *defaultobj) -/*[clinic end generated code: output=692f85384b0b292e input=178f0c81d496d5cd]*/ +dict_setdefault_impl(PyDictObject *self, PyObject *key, + PyObject *default_value) +/*[clinic end generated code: output=f8c1101ebf69e220 input=b2826255bacd845a]*/ { PyObject *val; - val = PyDict_SetDefault((PyObject *)self, key, defaultobj); + val = PyDict_SetDefault((PyObject *)self, key, default_value); Py_XINCREF(val); return val; } |