does python have useless destructors?

Carl Banks imbosol at aerojockey.invalid
Mon Jun 14 23:02:02 CEST 2004

David Turner wrote:
> Carl Banks <imbosol at aerojockey.invalid> wrote in message news:<g31zc.89734$DG4.42241 at>...
>> [snip]
>> > I don't need to know whether my function is the sole user of an object
>> > and it falls to me to free it when I'm done, because the system takes
>> > care of that.  I get it, I use it, I forget about it. 
>> The problem is, you can't always afford to forget about it.  Sometimes
>> you have to make sure that at this point in the program, this resource
>> has been released.
>> If you're relying on garbage collection to do that for you, you're
>> asking for trouble.
> Carl, this is why we're suggesting a mechanism other than garbage
> collection to deal with this.

Replace "garbage collection" with "automatic finalization" and
everything I just said is just as true.

> This is exactly how CPython works at the moment, bar one exceptional
> case which needs to be fixed.

What case is that?

CARL BANKS            
"If you believe in yourself, drink your school, stay on drugs, and
don't do milk, you can get work." 
          -- Parody of Mr. T from a Robert Smigel Cartoon

More information about the Python-list mailing list