does python have useless destructors?
Slawomir Nowaczyk
slawek at cs.lth.se
Sat Jun 12 16:56:51 EDT 2004
On 12 Jun 2004 03:21:26 -0700
dkturner at telkomsa.net (David Turner) wrote:
#> Well-defined destructor semantics have proven to be a robust,
#> reliable, and surprisingly general solution to a wide range of
#> problems. It wouldn't be *that* hard to implement them in Python -
#> so why not adopt a good idea?
I suppose most people would agree that well-defined destructor
semantic is a good thing to have. And those who praise try/finally
construct are just trying to say that you can use it to do what you
want, even if in a bit more complicated way.
The main problem, I suppose, is that it *would be* pretty hard to
implement RAII in an efficient and portable way.
Not impossible, of course, but hard.
--
Best wishes,
Slawomir Nowaczyk
( Slawomir.Nowaczyk at cs.lth.se )
Only drug dealers and software companies call their customers 'users.'
More information about the Python-list
mailing list