Guido van Rossum added the comment: On Jan 23, 2008 11:12 PM, Neal Norwitz <[EMAIL PROTECTED]> wrote: > > Neal Norwitz added the comment: > > I looked at Guido's latest deldict.diff patch--the one to > Objects/object.c only. It seems good. I can't convince myself either > way about the change to Objects/typeobject.c. I can't think of a way > to cause a problem. It seems safer to use Py_CLEAR in this case > though.
Here's my reasoning: the object whose dict is being cleared itself has a refcount of zero at this point. So it is truly unreachable from Python code. So I'm not going to submit that part of the change. > There are several other uses of _PyObject_GetDictPtr in > Objects/typeobject.c. It was pretty much the same--I can't convince > myself either way. Can Py_VISIT cause any Python code to execute that > might lead to a problem? The answer lies in the gc module which does all the visiting. A quick scan of all the traverse() calls there indicates that none of them call back into Python -- not a DECREF in sight. > The other uses of _PyObject_GetDictPtr in > Objects/typeobject.c seemed safer. Not a very useful review. I reviewed those too and found them safe. I'll submit the change now. _____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1303614> _____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com