On Jun 13, 2005, at 10:20 PM, Greg Ewing wrote: > Phillip J. Eby wrote: > > >> By the way, whatever happened to "and while"? i.e.: >> >> while True: >> data = inp.read(blocksize) >> and while data: >> out.write(data) >> > > My favourite version of this is > > while: > data = inp.read(blocksize) > gives data: > out.write(data) Well, we could always just make iterator factories for the common cases and stuff them in itertools. I do need to use this pattern from time to time, but primarily for this exact use case, so an "itertools.readby" or the like would probably solve this problem for most people most of the time. -bob
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