Skip to content

Commit

Permalink
pythongh-105373: PyObject_SetAttr(NULL) is no longer deprecated
Browse files Browse the repository at this point in the history
Remove the deprecation on the following functions:

* PyObject_SetAttr(obj, attr_name, NULL)
* PyObject_SetAttrString(obj, attr_name, NULL)
* PySequence_SetItem(obj, i, NULL)
* PySequence_SetSlice(obj, i1, i2, NULL)

Deprecation added by commit ed82604.
  • Loading branch information
vstinner committed Jun 6, 2023
1 parent 0cb6b9b commit 90d8ff3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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

0 comments on commit 90d8ff3

Please sign in to comment.