This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients Rhamphoryncus, arigo, brett.cannon, gvanrossum, jhylton, mwh, nnorwitz, zseil
Date 2008-01-24.17:05:12
SpamBayes Score 0.0065141516
Marked as misclassified No
Message-id <ca471dc20801240905k347084f0gf0c4c974cb7d1b96@mail.gmail.com>
In-reply-to <ee2a432c0801232312v9690ac8o214ac72cb1191f48@mail.gmail.com>
Content
On Jan 23, 2008 11:12 PM, Neal Norwitz <report@bugs.python.org> 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.
History
Date User Action Args
2008-01-24 17:05:15gvanrossumsetspambayes_score: 0.00651415 -> 0.0065141516
recipients: + gvanrossum, mwh, jhylton, nnorwitz, brett.cannon, arigo, Rhamphoryncus, zseil
2008-01-24 17:05:13gvanrossumlinkissue1303614 messages
2008-01-24 17:05:12gvanrossumcreate