when should I explicitly close a file?

Chris Rebert clp2 at rebertia.com
Thu Apr 22 03:03:29 CEST 2010


On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote:
> In message <4bc9aadb$1 at dnews.tpgi.com.au>, Lie Ryan wrote:
>
>> Since in python nothing is guaranteed about implicit file close ...
>
> It is guaranteed that objects with a reference count of zero will be
> disposed.

> In my experiments, this happens immediately.

Experiment with an implementation other than CPython and prepare to be
surprised.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list