mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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)
This commit is contained in:
parent
89072047b8
commit
2d0eb65f45
7 changed files with 213 additions and 181 deletions
|
@ -1425,15 +1425,15 @@ _PyObject_LookupSpecial(PyObject *self, _Py_Identifier *attrid)
|
|||
as lookup_method to cache the interned name string object. */
|
||||
|
||||
static PyObject *
|
||||
call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
|
||||
call_method(PyObject *obj, _Py_Identifier *name, const char *format, ...)
|
||||
{
|
||||
va_list va;
|
||||
PyObject *func = NULL, *retval;
|
||||
|
||||
func = lookup_maybe(o, nameid);
|
||||
func = lookup_maybe(obj, name);
|
||||
if (func == NULL) {
|
||||
if (!PyErr_Occurred())
|
||||
PyErr_SetObject(PyExc_AttributeError, nameid->object);
|
||||
PyErr_SetObject(PyExc_AttributeError, name->object);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1465,12 +1465,12 @@ call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
|
|||
/* Clone of call_method() that returns NotImplemented when the lookup fails. */
|
||||
|
||||
static PyObject *
|
||||
call_maybe(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
|
||||
call_maybe(PyObject *obj, _Py_Identifier *name, const char *format, ...)
|
||||
{
|
||||
va_list va;
|
||||
PyObject *func = NULL, *retval;
|
||||
|
||||
func = lookup_maybe(o, nameid);
|
||||
func = lookup_maybe(obj, name);
|
||||
if (func == NULL) {
|
||||
if (!PyErr_Occurred())
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue