Guido van Rossum <guido <at> python.org> writes: > > And, by the way, "for line in open(filename): ..." will continue to > work. It may just not close the file right away. This is a forgivable > sin in a small program that opens a few files only. It only becomes a > program when this is itself inside a loop that loops over many > filenames -- you could run out of file descriptors.
It can also be a problem under Windows where, IIRC, you can't delete a file which is still opened somewhere (even for reading). _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com