3 Feb
2003
3 Feb
'03
2:02 a.m.
with myfile = auto_closing_file('blah.txt', 'rb'): for line in myfile: ...
With Guido's 'do', you could define an iterclose():
do iterclose(open('blah.txt','rb')): (line): ...
Btw, the two snippets illustrate quite well the different evolutive directions' on the table.
I must say that, for this particular usage at least, I find the first one a darn sight easier to follow than the second!
I think 'do' is being misrepresented, and I also doubt that this is a very practical example. But I may have to wait until the next weekend before I can continue in this thread -- I can't work on this on workdays. --Guido van Rossum (home page: http://www.python.org/~guido/)