At 08:14 AM 6/13/2005 -0400, Jp Calderone wrote: >On Mon, 13 Jun 2005 01:25:51 -0400, "Phillip J. Eby" ><pje at telecommunity.com> 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. :)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4