<div dir="ltr">I like Py_DECREF_REPLACE. It gives the impression that it decrefs the original and replaces it.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 3:40 AM, Serhiy Storchaka <span dir="ltr"><<a href="mailto:storchaka@gmail.com" target="_blank">storchaka@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There were several suggestions for naming new macros which replace old value with new value and then (x)decref old value.<br>


<br>
#define Py_XXX(ptr, value)        \<br>
    {                             \<br>
        PyObject *__tmp__ = ptr;  \<br>
        ptr = new_value;          \<br>
        Py_DECREF(__tmp__);       \<br>
    }<br>
<br>
Listed in order of receipt:<br>
<br>
1. Py_(X)SETREF.<br>
2. Py_(X)ASSIGN.<br>
3. Py_(X)DECREC_REPLACE.<br>
4. Py_REF_ASSIGN (Py_XREF_ASSIGN? Py_REF_XASSIGN?).<br>
5. Py_(X)REPLACE.<br>
6. Py_(X)STORE<br>
7. Py_CLEAR_AND_SET.<br>
8. Py_SET_AND_(X)DECREF.<br>
9. Py_(X)DECREF_AND_ASSIGN.<br>
10. Py_ASSIGN_AND_(X)DECREF.<br>
11. Other...<br>
<br>
Let's choose the least confusing names.<br>
<br>
See discussions at:<br>
<br>
<a href="http://bugs.python.org/issue3081" target="_blank">http://bugs.python.org/<u></u>issue3081</a><br>
<a href="http://bugs.python.org/issue16447" target="_blank">http://bugs.python.org/<u></u>issue16447</a><br>
<a href="http://bugs.python.org/issue20440" target="_blank">http://bugs.python.org/<u></u>issue20440</a><br>
<a href="http://comments.gmane.org/gmane.comp.python.devel/145346" target="_blank">http://comments.gmane.org/<u></u>gmane.comp.python.devel/145346</a><br>
<br>
______________________________<u></u>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com" target="_blank">https://mail.python.org/<u></u>mailman/options/python-dev/<u></u>rymg19%40gmail.com</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Ryan<div><div>If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."</div>

</div><div><br></div></div>
</div>