@@ -33,25 +33,27 @@ Tuple Objects
3333
3434.. c :function :: PyObject* PyTuple_New (Py_ssize_t len)
3535
36- Return a new tuple object of size *len*, or ``NULL`` on failure.
36+ Return a new tuple object of size *len*,
37+ or ``NULL`` with an exception set on failure.
3738
3839
3940.. c:function:: PyObject* PyTuple_Pack(Py_ssize_t n, ...)
4041
41- Return a new tuple object of size *n*, or ``NULL`` on failure. The tuple values
42+ Return a new tuple object of size *n*,
43+ or ``NULL`` with an exception set on failure. The tuple values
4244 are initialized to the subsequent *n* C arguments pointing to Python objects.
4345 ``PyTuple_Pack(2, a, b)`` is equivalent to ``Py_BuildValue("(OO)", a, b)``.
4446
4547
4648.. c:function:: Py_ssize_t PyTuple_Size(PyObject *p)
4749
4850 Take a pointer to a tuple object, and return the size of that tuple.
51+ On error, return ``-1 `` and with an exception set.
4952
5053
5154.. c :function :: Py_ssize_t PyTuple_GET_SIZE (PyObject *p)
5255
53- Return the size of the tuple *p *, which must be non-``NULL `` and point to a tuple;
54- no error checking is performed.
56+ Like :c:func: `PyTuple_Size `, but without error checking.
5557
5658
5759.. c :function :: PyObject* PyTuple_GetItem (PyObject *p, Py_ssize_t pos)
@@ -74,8 +76,10 @@ Tuple Objects
7476.. c :function :: PyObject* PyTuple_GetSlice (PyObject *p, Py_ssize_t low, Py_ssize_t high)
7577
7678 Return the slice of the tuple pointed to by *p * between *low * and *high *,
77- or ``NULL `` on failure. This is the equivalent of the Python expression
78- ``p[low:high] ``. Indexing from the end of the tuple is not supported.
79+ or ``NULL `` with an exception set on failure.
80+
81+ This is the equivalent of the Python expression ``p[low:high] ``.
82+ Indexing from the end of the tuple is not supported.
7983
8084
8185.. c :function :: int PyTuple_SetItem (PyObject *p, Py_ssize_t pos, PyObject *o)
@@ -135,6 +139,8 @@ type.
135139 Create a new struct sequence type from the data in *desc *, described below. Instances
136140 of the resulting type can be created with :c:func: `PyStructSequence_New `.
137141
142+ Return ``NULL `` with an exception set on failure.
143+
138144
139145.. c :function :: void PyStructSequence_InitType (PyTypeObject *type, PyStructSequence_Desc *desc)
140146
@@ -143,8 +149,8 @@ type.
143149
144150.. c :function :: int PyStructSequence_InitType2 (PyTypeObject *type, PyStructSequence_Desc *desc)
145151
146- The same as `` PyStructSequence_InitType `` , but returns ``0 `` on success and `` -1 `` on
147- failure.
152+ Like :c:func: ` PyStructSequence_InitType `, but returns ``0 `` on success
153+ and `` -1 `` with an exception set on failure.
148154
149155 .. versionadded :: 3.4
150156
@@ -201,6 +207,8 @@ type.
201207 Creates an instance of *type *, which must have been created with
202208 :c:func: `PyStructSequence_NewType `.
203209
210+ Return ``NULL `` with an exception set on failure.
211+
204212
205213.. c :function :: PyObject* PyStructSequence_GetItem (PyObject *p, Py_ssize_t pos)
206214
0 commit comments