Skip to content

gh-105373: Remove the PyObject_SetAttr(NULL) deprecation #105374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 4 additions & 5 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ Object Protocol
return ``0`` on success. This is the equivalent of the Python statement
``o.attr_name = v``.

If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated
in favour of using :c:func:`PyObject_DelAttr`, but there are currently no
plans to remove it.
Delete the attribute named *attr_name* if *v* is ``NULL``. The function
:c:func:`PyObject_DelAttr` is preferred to delete an attribute.


.. c:function:: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v)
Expand All @@ -93,8 +92,8 @@ Object Protocol
return ``0`` on success. This is the equivalent of the Python statement
``o.attr_name = v``.

If *v* is ``NULL``, the attribute is deleted, but this feature is
deprecated in favour of using :c:func:`PyObject_DelAttrString`.
Delete the attribute named *attr_name* if *v* is ``NULL``. The function
:c:func:`PyObject_DelAttrString` is preferred to delete an attribute.


.. c:function:: int PyObject_GenericSetAttr(PyObject *o, PyObject *name, PyObject *value)
Expand Down
7 changes: 5 additions & 2 deletions Doc/c-api/sequence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Sequence Protocol
is the equivalent of the Python statement ``o[i] = v``. This function *does
not* steal a reference to *v*.

If *v* is ``NULL``, the element is deleted, but this feature is
deprecated in favour of using :c:func:`PySequence_DelItem`.
Delete the *i*\ th element if *v* is ``NULL``. The function
:c:func:`PySequence_DelItem` is preferred to delete an element.


.. c:function:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)
Expand All @@ -84,6 +84,9 @@ Sequence Protocol
Assign the sequence object *v* to the slice in sequence object *o* from *i1* to
*i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``.

Delete the elements if *v* is ``NULL``. The function
:c:func:`PySequence_DelSlice` is preferred to delete elements.


.. c:function:: int PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2)

Expand Down