to close or not to close?

Grant Edwards ge at nowhere.none
Tue Aug 1 11:02:11 EDT 2000


In article <8m5vfk01gl3 at news2.newsguy.com>, Alex Martelli wrote:

>I think that depends on the programming culture one comes from.
>People with a C++ background are used to powerful idioms
>relying on destructors to free all kinds of resources; people
>with a Java background are used to explicit releasing (of
>non-memory resources), since finalize is not called reliably
>(the very explicit try/finally construct directly supports this
>style).  Other languages tend to fall into one or the other of
>these categories, too.
>
>Python provides both reliably-called destructors (at least in
>CPython it does; the JPython or .NET dialects may work
>differently), _and_ try/finally, so there is really no 'pull'
>from the language itself towards one or the other idiom.

I think we're loosing one of the big advantages of Python if
users can't rely on objects "going away" when they're no longer
used and instead have to explicitly free() them.  The current
reference-counting problem that CPython has with circular
references is something I can live.  Having to explicitly
dispose of objects when I'm done with them would completely
ruin the "feel" of the language.

-- 
Grant Edwards                   grante             Yow!  Yow! We're going to
                                  at               a new disco!
                               visi.com            



More information about the Python-list mailing list