Alexander Belopolsky added the comment:

I am late to this discussion, but FWIW, I would like to back Raymond up.  For 
me, Py_XDECREF is usually a sign of lazy programming and an optimization 
opportunity.  In many cases I've seen, Py_XDECREF is used under a "done:" label 
and can be optimized by strategically placing Py_DECREFs before (error) returns 
while keeping track of what is and what is not initialized. In addition to an 
extra null check, Py_XDECREF typically requires a NULL initialization which can 
be avoided with a more thoughtful code structure.

All in all, Py_XDECREF rightfully stands out with an "X" spelling.  I don't 
want to see it hidden behind an innocent-looking convenience macro.

I am ±0 on the XSETREF variant, but I think SETREF should use DECREF.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26200>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to