We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0f82dd commit 15be34aCopy full SHA for 15be34a
Doc/c-api/tuple.rst
@@ -59,6 +59,12 @@ Tuple Objects
59
Return the object at position *pos* in the tuple pointed to by *p*. If *pos* is
60
negative or out of bounds, return ``NULL`` and set an :exc:`IndexError` exception.
61
62
+ The returned reference is borrowed from the tuple *p*
63
+ (that is: it is only valid as long as you hold a reference to *p*).
64
+ To get a :term:`strong reference`, use
65
+ :c:func:`Py_NewRef(PyTuple_GetItem(...)) <Py_NewRef>`
66
+ or :c:func:`PySequence_GetItem`.
67
+
68
69
.. c:function:: PyObject* PyTuple_GET_ITEM(PyObject *p, Py_ssize_t pos)
70
0 commit comments