This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, python-dev, rhettinger, serhiy.storchaka, skrah
Date 2016-03-22.17:29:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458667771.99.0.569855291991.issue26200@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-03-22 17:29:32belopolskysetrecipients: + belopolsky, rhettinger, skrah, python-dev, serhiy.storchaka
2016-03-22 17:29:31belopolskysetmessageid: <1458667771.99.0.569855291991.issue26200@psf.upfronthosting.co.za>
2016-03-22 17:29:31belopolskylinkissue26200 messages
2016-03-22 17:29:31belopolskycreate