does python have useless destructors?
slawek at cs.lth.se
Sat Jun 12 22:56:51 CEST 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.
( Slawomir.Nowaczyk at cs.lth.se )
Only drug dealers and software companies call their customers 'users.'
More information about the Python-list