[docs] Documentation prototype for PyStructSequence_SET_ITEM(..) is incorrect in 3.x?

Daniel Hooper 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

PyStructSequence_SetItem

is not, 

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)
from https://github.com/python/cpython/blob/master/Include/structseq.h

and
#define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v)
from https://github.com/python/cpython/blob/master/Include/cpython/tupleobject.h

.

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
(214) 267-8780
http://hooper.engineering





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20190724/34224033/attachment-0001.html>


More information about the docs mailing list