gh-106572: Convert PyObject_DelAttr() to a function (#106611)

* Convert PyObject_DelAttr() and PyObject_DelAttrString() macros to
  functions.
* Add PyObject_DelAttr() and PyObject_DelAttrString() functions to
  the stable ABI.
* Replace PyObject_SetAttr(obj, name, NULL) with
  PyObject_DelAttr(obj, name).
This commit is contained in:
Victor Stinner
2023-07-11 11:38:22 +02:00
committed by GitHub
parent e6379f72cb
commit 1f2921b72c
12 changed files with 33 additions and 8 deletions

View File

@@ -942,6 +942,12 @@ PyObject_SetAttrString(PyObject *v, const char *name, PyObject *w)
return res;
}
int
PyObject_DelAttrString(PyObject *v, const char *name)
{
return PyObject_SetAttrString(v, name, NULL);
}
int
_PyObject_IsAbstract(PyObject *obj)
{
@@ -1185,6 +1191,12 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
return -1;
}
int
PyObject_DelAttr(PyObject *v, PyObject *name)
{
return PyObject_SetAttr(v, name, NULL);
}
PyObject **
_PyObject_ComputedDictPointer(PyObject *obj)
{