8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e6fa5f commit 4605a19Copy full SHA for 4605a19
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