does python have useless destructors?

David Turner dkturner at
Fri Jun 18 10:34:35 CEST 2004

Peter Hansen <peter at> wrote in message news:<kvydnbTEiZ5sMUzdRVn-gQ at>...
> David Turner wrote:
> > Peter Hansen <peter at> wrote in message news:<htudnXIw-_HkalPdRVn-gQ at>...
> >>Since it's therefore obviously not a property of these languages
> >>that they are robust or not, it must be something more to do with
> >>the programmers, or the process, or something.  I guess...  ;-)
> > 
> > I don't see how the "obviously" bit follows.  
> It was just that you've had non-robust code in Python and
> robust code in C++, while I've had the other way around.
> Therefore obviously it's not a property of the language,
> but more about how we're using them... something like that.

I see what you mean.  Yes, I agree that the idioms used make all the
difference, and that there are "safe" idioms in every language which
should be promoted.

I would still dearly love to see the RAII idiom available in Python,
however, as I don't think there can be any doubt that it's safer than
the try/finally idiom.  It's another tool in the toolbox...

David Turner

More information about the Python-list mailing list