STINNER Victor <[email protected]> added the comment:
PySequence_Fast_ITEMS() is used in numpy at 7 lines:
numpy/core/src/common/ufunc_override.c:118: *out_objs =
PySequence_Fast_ITEMS(seq);
---
PyUFuncOverride_GetOutObjects(PyObject *kwds, PyObject **out_kwd_obj, PyObject
***out_objs)
---
=> PyObject** is part of the numpy C API (it's even a pointer to a PyObject**
array)!
numpy/core/src/multiarray/arrayfunction_override.c:80: PyObject **items =
PySequence_Fast_ITEMS(relevant_args);
---
static int
get_implementing_args_and_methods(PyObject *relevant_args,
PyObject **implementing_args,
PyObject **methods)
{
int num_implementing_args = 0;
Py_ssize_t i;
int j;
PyObject **items = PySequence_Fast_ITEMS(relevant_args);
Py_ssize_t length = PySequence_Fast_GET_SIZE(relevant_args);
for (i = 0; i < length; i++) {
int new_class = 1;
PyObject *argument = items[i];
----
=> here PySequence_Fast_GET_ITEM() can be used instead.
numpy/core/src/multiarray/arrayfunction_override.c:167: PyObject **items =
PySequence_Fast_ITEMS(types);
numpy/core/src/multiarray/common.c:434: objects = PySequence_Fast_ITEMS(seq);
numpy/core/src/multiarray/iterators.c:1368: ret = multiiter_new_impl(n,
PySequence_Fast_ITEMS(fast_seq));
numpy/core/src/multiarray/methods.c:1015: in_objs =
PySequence_Fast_ITEMS(fast);
numpy/core/src/umath/override.c:38: arg_objs = PySequence_Fast_ITEMS(args);
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41078>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com