threading support in python
apardon at forel.vub.ac.be
Thu Sep 7 10:02:57 CEST 2006
On 2006-09-06, sjdevnull at yahoo.com <sjdevnull at yahoo.com> wrote:
> Paul Rubin wrote:
>> "sjdevnull at yahoo.com" <sjdevnull at yahoo.com> writes:
>> > (1) I think is here to stay, if you're going to tell programmers that
>> > their destructors can't make program-visible changes (e.g. closing the
>> > database connection when a dbconn is destroyed), that's a _huge_ change
>> > from current practice that needs serious debate.
>> We had that debate already (PEP 343). Yes, there is some sloppy
>> current practice by CPython users that relies on the GC to close the
>> db conn.
> This point is unrelated to with or ref-counting. Even the standard
> library will close file objects when they are GC'd.
This is not totally true. My experience is that if you use the
tarfile module any tarfile that was opened for appending or
writing risks being corrupted if it isn't closed explicedly.
More information about the Python-list