"John Doe" <[EMAIL PROTECTED]> wrote:

> In an effort to avoid another potential mistake, I am wondering if the
> anonymous file object/class/thingy that I create when I do file("text.txt',
> "w").write("stuff") gets closed properly on exit or garbage collection or
> something

yes.

> or if I always need to hang on to these things and close them myself.

only if you want to 1) know exactly when the files are closed, or 2) are
using so many files that the garbage collector cannot keep up with you
(this never happens on CPython, but can, at least in theory, happen on
other Python implementations)

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to