(original) (raw)
On 19 Mar 2014 07:34, "MRAB" <stackoverflow@mrabarnett.plus.com> wrote:
\> FWIW, I haven't been following the discussion,
Note that this about correctness, not just clarity - using DECREF on member attributes is not safe, as you may end up exposing a partially destroyed object to other code.
> but, after a (very)
\> quick look, to me:
\>
\> � � Py\_XDECREF(ptr);
\> � � ptr = NULL;
\>
\> would be clearer as:
\>
\> � � Py\_CLEAR\_REF(ptr);
Already exists as Py\_CLEAR (with the correct temp variable usage).
> and:
\>
\> � � �Py\_XDECREF(ptr);
\> � � �ptr = new\_value;
\>
\> would be clearer as:
\>
\> � � Py\_REPLACE\_REF(ptr, new\_value);
That is indeed the one we're aiming to find a suitable name for.
Cheers,
Nick.
>
\>
\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\> Python-Dev mailing list
\> Python-Dev@python.org
\> https://mail.python.org/mailman/listinfo/python-dev
\> Unsubscribe: https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com