[Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etc
barry at python.org
Fri Feb 28 23:49:17 CET 2014
On Mar 01, 2014, at 08:15 AM, Nick Coghlan wrote:
>It *is* playing refcounting games - it's decrefing the existing target
>while stealing a reference to the new target, just like the existing
>SET_ITEM macros and somewhat like Py_CLEAR (although in that case, it's
>more obvious that we will never incref NULL).
Okay, but "setting the reference" isn't one of them, which is what I read when
I see Py_SETREF. ;)
>The whole point of this macro is to take an *existing* reference and safely
>*overwrite* another existing reference, exactly as the SET_ITEM macros do.
>That actually gives me an idea that wasn't on Serhiy's original list:
That does seem better.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: not available
More information about the Python-Dev