does python have useless destructors?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Jun 15 14:32:04 EDT 2004


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.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/




More information about the Python-list mailing list