[Python-Dev] Add Py_REPLACE and Py_XREPLACE macros
storchaka at gmail.com
Wed Jan 29 19:24:41 CET 2014
The Py_CLEAR macros is used as safe alternative for following unsafe
ptr = NULL;
But other unsafe idiomatic code is widely used in the sources:
ptr = new_value;
Every occurrence of such code is potential bug for same reasons as for
It was offered  to introduce new macros Py_REPLACE and Py_XREPLACE
for safe replace with Py_DECREF and Py_XDECREF respectively.
Automatically generated patch contains about 50 replaces .
More information about the Python-Dev