[Python-Dev] finalization again (original) (raw)

Barry A. Warsaw bwarsaw@cnri.reston.va.us
Thu, 9 Mar 2000 23:21:46 -0500 (EST)


Okay, I had a flash of inspiration on the way home from my gig tonight. Of course, I'm also really tired so I'm sure Tim will shoot this down in his usual witty but humbling way. I just had to get this out or I wouldn't sleep tonight.

What if you timestamp instances when you create them? Then when you have trash cycles with finalizers, you sort them and finalize in chronological order. The nice thing here is that the user can have complete control over finalization order by controlling object creation order.

Some random thoughts:

I think I came up with a few more points on the drive home, but my post jam, post lightbulb endorphodrenalin rush is quickly subsiding, so I leave the rest until tomorrow.

its-simply-a-matter-of-time-ly y'rs, -Barry