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 tim.peters
Recipients
Date 2004-10-30.18:47:51
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

> There is only one minor issue that I can think of.  We
> decide which callbacks to invoke inside
> move_troublemakers().  It's possible that unreachable
> weakrefs become reachable when
> move_finalizer_reachable() is called (i.e. weakrefs that
> would be trash except that they got revived because they
> were referenced by an object with a __del__ method).
>
> However, since those weakrefs would have been trash I
> think it's okay not to invoke their callbacks.

I sure agree there are grey areas here!  Since I hate __del__ 
methods, I'm afraid I tend to have a "oh, who gives a shit?" 
attitude toward them.

There are also grey areas here outside of cyclic gc.  Take a 
look at subtype_dealloc:  that calls PyObject_ClearWeakRefs
() before calling a __del__ method, so invokes weakref 
callbacks even if the object doesn't actually go away (the 
__del__ method could still resurrect it).  Is that right or 
wrong?  Beats me.

I need to think more about this.  Offhand I'm inclined to agree 
that your reworking to crawl over unreachable twice is the 
more principled approach.  I only cringe because it *is* 
twice, and so probably a little slower.

Can you write a test where it makes a visible difference?
History
Date User Action Args
2007-08-23 14:27:07adminlinkissue1055820 messages
2007-08-23 14:27:07admincreate