Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, robert wrote: > > > * Ruby without refcounts provides no deterministic __del__ in > > non-circular refs ==> your type finally finally finally .close .close > > .close all the time > > Which is what you should type in Python too as there's no guarantee that > `__del__()` will be called immidiatly when the file object goes out of > scope or isn't referenced anymore. The reference counting memory > management is an implementation detail.
Absolutely true -- which is why Python 2.5 adds a new `with' statement that allows using the powerful idiom "resource acquisition is initialization" without relying on any implementation details (yay!). Alex -- http://mail.python.org/mailman/listinfo/python-list