Message262204
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. |
|
Date |
User |
Action |
Args |
2016-03-22 17:29:32 | belopolsky | set | recipients:
+ belopolsky, rhettinger, skrah, python-dev, serhiy.storchaka |
2016-03-22 17:29:31 | belopolsky | set | messageid: <1458667771.99.0.569855291991.issue26200@psf.upfronthosting.co.za> |
2016-03-22 17:29:31 | belopolsky | link | issue26200 messages |
2016-03-22 17:29:31 | belopolsky | create | |
|