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 vstinner
Recipients python-dev, rhettinger, serhiy.storchaka, vstinner
Date 2016-02-10.22:26:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455143210.93.0.426639347101.issue26200@psf.upfronthosting.co.za>
In-reply-to
Content
> New changeset 3084914245d2 by Raymond Hettinger in branch 'default':
> Issue #26200:  The SETREF macro adds unnecessary work in some cases.
> https://hg.python.org/cpython/rev/3084914245d2

The code using Py_DECREF() doesn't look to be vulnerable to the bug described in Py_SETREF() doc. The change (revert) looks good to me.

So I understand that calling Py_DECREF() manually (in the "right" order, as done in the change) is a reasonable answer to users wanting a "fast" Py_SETREF().

What do you think?

I don't suggest to mention it in Py_SETREF() documentation. I would prefer that users who don't understand well reference counting (ex: me ;-)) use Py_SETREF() to avoid bugs.
History
Date User Action Args
2016-02-10 22:26:50vstinnersetrecipients: + vstinner, rhettinger, python-dev, serhiy.storchaka
2016-02-10 22:26:50vstinnersetmessageid: <1455143210.93.0.426639347101.issue26200@psf.upfronthosting.co.za>
2016-02-10 22:26:50vstinnerlinkissue26200 messages
2016-02-10 22:26:50vstinnercreate