[docs] Documentation prototype for PyStructSequence_SET_ITEM(..) is incorrect in 3.x?
daniel at hooper.engineering
Wed Jul 24 12:48:00 EDT 2019
In 3.7.4 and in several other 3.x versions as well at https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_SetItem <https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_SetItem>
I noticed that PyStructSequence_SET_ITEM is defined
void PyStructSequence_SET_ITEM(PyObject *p, Py_ssize_t *pos, PyObject *o)
with the Py_ssize_t *pos defined as a POINTER, however
void PyStructSequence_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
This doesn’t make sense to me, because it appears that the definition is
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
#define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v)
Various examples seem to just use a number from 0 to N. Between the definition and those usage examples, that does not seem to support being documented as a pointer type.
Daniel Hooper, P.E.
Hooper Engineering, LLC
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the docs