News for hackers. Stuff that matters.
Re:A Programming Idiom You've Never Heard Of by yangyang on Wednesday January 04, 2012 @08:47AM (#3424066)
Perhaps in this case - but how about a case where you partially iterate over the file, but then the file object goes out of scope? CPython would close (and free) that immediately, but other implementations probably wouldn't.
Re:A Programming Idiom You've Never Heard Of by rbanffy on Wednesday January 04, 2012 @09:07AM (#3424143)
While editing the answer to masklinn comment, this case came to me. You both are, of course, right. There is no reliable way to close the file from the for iterator.

:-/