diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-12-06 15:27:24 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-12-06 15:27:24 (GMT) |
commit | 2d0eb65f455ddd66f74ad01a8f4a44d271f2a3da (patch) | |
tree | 44ddb2baab8b1ca9e4ff117cb87a878bd4f07e4f /Python | |
parent | 89072047b86e90f415d4d7727733150b89f72b32 (diff) | |
download | cpython-2d0eb65f455ddd66f74ad01a8f4a44d271f2a3da.zip cpython-2d0eb65f455ddd66f74ad01a8f4a44d271f2a3da.tar.gz cpython-2d0eb65f455ddd66f74ad01a8f4a44d271f2a3da.tar.bz2 |
Uniformize argument names of "call" functions
Issue #28838: Rename parameters of the "calls" functions of the Python C API.
* Rename 'callable_object' and 'func' to 'callable': any Python callable object
is accepted, not only Python functions
* Rename 'method' and 'nameid' to 'name' (method name)
* Rename 'o' to 'obj'
* Move, fix and update documentation of PyObject_CallXXX() functions
in abstract.h
* Update also the documentaton of the C API (update parameter names)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 7 | ||||
-rw-r--r-- | Python/modsupport.c | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index ca876e0..8b17c09 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4637,7 +4637,8 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf) The arg must be a tuple or NULL. The kw must be a dict or NULL. */ PyObject * -PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) +PyEval_CallObjectWithKeywords(PyObject *callable, + PyObject *args, PyObject *kwargs) { #ifdef Py_DEBUG /* PyEval_CallObjectWithKeywords() must not be called with an exception @@ -4647,7 +4648,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) #endif if (args == NULL) { - return _PyObject_FastCallDict(func, NULL, 0, kwargs); + return _PyObject_FastCallDict(callable, NULL, 0, kwargs); } if (!PyTuple_Check(args)) { @@ -4662,7 +4663,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) return NULL; } - return PyObject_Call(func, args, kwargs); + return PyObject_Call(callable, args, kwargs); } const char * diff --git a/Python/modsupport.c b/Python/modsupport.c index 06bdcab..3ae3fea 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -487,7 +487,7 @@ va_build_value(const char *format, va_list va, int flags) PyObject * -PyEval_CallFunction(PyObject *obj, const char *format, ...) +PyEval_CallFunction(PyObject *callable, const char *format, ...) { va_list vargs; PyObject *args; @@ -501,7 +501,7 @@ PyEval_CallFunction(PyObject *obj, const char *format, ...) if (args == NULL) return NULL; - res = PyEval_CallObject(obj, args); + res = PyEval_CallObject(callable, args); Py_DECREF(args); return res; @@ -509,14 +509,14 @@ PyEval_CallFunction(PyObject *obj, const char *format, ...) PyObject * -PyEval_CallMethod(PyObject *obj, const char *methodname, const char *format, ...) +PyEval_CallMethod(PyObject *obj, const char *name, const char *format, ...) { va_list vargs; PyObject *meth; PyObject *args; PyObject *res; - meth = PyObject_GetAttrString(obj, methodname); + meth = PyObject_GetAttrString(obj, name); if (meth == NULL) return NULL; |