STINNER Victor added the comment:

> 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.

----------
nosy: +haypo

_______________________________________
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