mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)
* _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the first argument to PyTupleObject*. This internal macro is only usable if Py_BUILD_CORE is defined. * Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob). * Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].
This commit is contained in:
parent
130893debf
commit
d17a693fa0
9 changed files with 27 additions and 23 deletions
|
@ -247,7 +247,7 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwargs)
|
|||
}
|
||||
|
||||
result = _PyMethodDef_RawFastCallDict(descr->d_method, self,
|
||||
&PyTuple_GET_ITEM(args, 1), nargs - 1,
|
||||
&_PyTuple_ITEMS(args)[1], nargs - 1,
|
||||
kwargs);
|
||||
result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL);
|
||||
return result;
|
||||
|
@ -331,7 +331,7 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args,
|
|||
}
|
||||
|
||||
result = _PyMethodDef_RawFastCallDict(descr->d_method, self,
|
||||
&PyTuple_GET_ITEM(args, 1), argc - 1,
|
||||
&_PyTuple_ITEMS(args)[1], argc - 1,
|
||||
kwds);
|
||||
result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL);
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue