mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-39245: Switch to public API for Vectorcall (GH-18460)
The bulk of this patch was generated automatically with:
for name in \
PyObject_Vectorcall \
Py_TPFLAGS_HAVE_VECTORCALL \
PyObject_VectorcallMethod \
PyVectorcall_Function \
PyObject_CallOneArg \
PyObject_CallMethodNoArgs \
PyObject_CallMethodOneArg \
;
do
echo $name
git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g"
done
old=_PyObject_FastCallDict
new=PyObject_VectorcallDict
git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g"
and then cleaned up:
- Revert changes to in docs & news
- Revert changes to backcompat defines in headers
- Nudge misaligned comments
This commit is contained in:
parent
f3e7ea5b8c
commit
ffd9753a94
56 changed files with 194 additions and 194 deletions
|
|
@ -4846,7 +4846,7 @@ test_pyobject_fastcalldict(PyObject *self, PyObject *args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return _PyObject_FastCallDict(func, stack, nargs, kwargs);
|
||||
return PyObject_VectorcallDict(func, stack, nargs, kwargs);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4880,7 +4880,7 @@ test_pyobject_vectorcall(PyObject *self, PyObject *args)
|
|||
PyErr_SetString(PyExc_TypeError, "kwnames must be None or a tuple");
|
||||
return NULL;
|
||||
}
|
||||
return _PyObject_Vectorcall(func, stack, nargs, kwnames);
|
||||
return PyObject_Vectorcall(func, stack, nargs, kwnames);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -5253,7 +5253,7 @@ meth_fastcall_keywords(PyObject* self, PyObject* const* args,
|
|||
if (pyargs == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
PyObject *pykwargs = _PyObject_Vectorcall((PyObject*)&PyDict_Type,
|
||||
PyObject *pykwargs = PyObject_Vectorcall((PyObject*)&PyDict_Type,
|
||||
args + nargs, 0, kwargs);
|
||||
return Py_BuildValue("NNN", _null_to_none(self), pyargs, pykwargs);
|
||||
}
|
||||
|
|
@ -6133,7 +6133,7 @@ static PyTypeObject MethodDescriptorBase_Type = {
|
|||
.tp_call = PyVectorcall_Call,
|
||||
.tp_vectorcall_offset = offsetof(MethodDescriptorObject, vectorcall),
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
|
||||
Py_TPFLAGS_METHOD_DESCRIPTOR | _Py_TPFLAGS_HAVE_VECTORCALL,
|
||||
Py_TPFLAGS_METHOD_DESCRIPTOR | Py_TPFLAGS_HAVE_VECTORCALL,
|
||||
.tp_descr_get = func_descr_get,
|
||||
};
|
||||
|
||||
|
|
@ -6172,7 +6172,7 @@ static PyTypeObject MethodDescriptor2_Type = {
|
|||
.tp_new = MethodDescriptor2_new,
|
||||
.tp_call = PyVectorcall_Call,
|
||||
.tp_vectorcall_offset = offsetof(MethodDescriptor2Object, vectorcall),
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | _Py_TPFLAGS_HAVE_VECTORCALL,
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_VECTORCALL,
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(heapgctype__doc__,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue