Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update the doc
  • Loading branch information
vstinner committed Jun 28, 2023
commit 9eb147dc58a58a77c7b525948f94505425a5c20c
4 changes: 4 additions & 0 deletions Doc/c-api/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ List Objects
Macro form of :c:func:`PyList_SetItem` without error checking. This is
normally only used to fill in new lists where there is no previous content.

Bounds checking is performed as an assertion if Python is built in
:ref:`debug mode <debug-build>` or :option:`with assertions
<--with-assertions>`.

.. note::

This macro "steals" a reference to *item*, and, unlike
Expand Down
23 changes: 16 additions & 7 deletions Doc/c-api/tuple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ Tuple Objects
Like :c:func:`PyTuple_SetItem`, but does no error checking, and should *only* be
used to fill in brand new tuples.

Bounds checking is performed as an assertion if Python is built in
:ref:`debug mode <debug-build>` or :option:`with assertions <--with-assertions>`.

.. note::

This function "steals" a reference to *o*, and, unlike
Expand Down Expand Up @@ -194,12 +197,17 @@ type.
.. c:function:: PyObject* PyStructSequence_GetItem(PyObject *p, Py_ssize_t pos)

Return the object at position *pos* in the struct sequence pointed to by *p*.
No bounds checking is performed.

Bounds checking is performed as an assertion if Python is built in
:ref:`debug mode <debug-build>` or :option:`with assertions <--with-assertions>`.


.. c:function:: PyObject* PyStructSequence_GET_ITEM(PyObject *p, Py_ssize_t pos)

Macro equivalent of :c:func:`PyStructSequence_GetItem`.
Alias to :c:func:`PyStructSequence_GetItem`.

.. versionchanged:: 3.13
Now implemented as an alias to :c:func:`PyStructSequence_GetItem`.


.. c:function:: void PyStructSequence_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o)
Expand All @@ -208,16 +216,17 @@ type.
:c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand new
instances.

Bounds checking is performed as an assertion if Python is built in
:ref:`debug mode <debug-build>` or :option:`with assertions <--with-assertions>`.

.. note::

This function "steals" a reference to *o*.


.. c:function:: void PyStructSequence_SET_ITEM(PyObject *p, Py_ssize_t *pos, PyObject *o)

Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static
inlined function.
Alias to :c:func:`PyStructSequence_SetItem`.

.. note::

This function "steals" a reference to *o*.
.. versionchanged:: 3.13
Now implemented as an alias to :c:func:`PyStructSequence_SetItem`.