does python have useless destructors?
Donn Cave
donn at u.washington.edu
Thu Jun 17 12:52:36 EDT 2004
In article <e251b7ba.0406170622.1f49d52b at posting.google.com>,
dkturner at telkomsa.net (David Turner) wrote:
> 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?
Gross efficiency considerations in the Java implementation,
specifically.
Donn Cave, donn at u.washington.edu
More information about the Python-list
mailing list