On 19 Mar 2014 07:34, "MRAB" <stackoverflow at 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 at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140319/2a565f99/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4