does python have useless destructors?

David Turner dkturner at telkomsa.net
Thu Jun 17 10:22:22 EDT 2004


Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> wrote in message news:<pan.2004.06.15.18.32.04.961249 at knm.org.pl>...
> On Tue, 15 Jun 2004 11:26:33 -0700, Donn Cave wrote:
> 
> > But never one to be deterred by pointlessness,
> > suppose __finalize__ were a flag, instead of a method.  It
> > has two functions:  1.  declare that the object's __del__
> > method should be called when it's logically unreferenced -
> > either no references, or only referenced as part of a cycle
> > or traceback.  2.  Serve as the extra reference count that's
> > needed for this, so __del__ will only be called once regardless
> > of further reference decrements, cycle analysis etc.
> 
> I will repeat: it's unimplementable efficiently when
> Python runtime is hosted by a language with non-refcount GC.

So are we to take it that efficiency considerations are a serious
impediment to a potentially valuable safety feature?

Regards
David Turner



More information about the Python-list mailing list