At 08:14 AM 6/13/2005 -0400, Jp Calderone wrote: >On Mon, 13 Jun 2005 01:25:51 -0400, "Phillip J. Eby" ><[EMAIL PROTECTED]> wrote: > >Block-copying a file with read() has the same pattern (e.g. in shutil), but > >you can't make it a for loop. > >Anything can be a for loop. > > for chunk in iter(lambda: f1.read(CHUNK_SIZE), ''): > f2.write(chunk)
Showoff. ;) More seriously, I think your translation makes an excellent argument in *favor* of having a do/while statement for greater clarity. :) _______________________________________________ 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