[issue22039] PyObject_SetAttr doesn't mention value = NULL
Petr Viktorin
report at bugs.python.org
Mon Jan 17 09:16:20 EST 2022
Petr Viktorin <encukou at gmail.com> added the comment:
This cannot be changed in 3.x, since the PyObject_DelAttr macro calls PyObject_SetAttr(..., NULL), and the macro is expanded in all extensions that use the stable ABI.
(Technically, it would be possible to add a PyObject_SetAttr *macro* that would warn/fail, while keeping the PyObject_SetAttr *function* untouched, but that would be a pain to test/maintain.)
The wording could be clarified to something like: "This behaviour is deprecated in favour of using PyObject_DelAttr(), but there are currently no plans to remove it."
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22039>
_______________________________________
More information about the Python-bugs-list
mailing list