On 9/22/05, Jim Jewett <jimjjewett at gmail.com> wrote: > "Is there anything left?" is a pretty analogy for iterators, But unmaintainable for iterators in general. This was considered ad nauseam when iterators were initially introduced, and it was an explicit decision *not* to provide an API to look ahead. We should *not* give people a way to start coding like this: while it: x = it.next() ...process x... when they should be writing this instead: for x in it: ...process x... How would you implement the "is there anything left" functionality if the iterator is in fact a generator? (I know, the answer is buffering. But that has problems too. It was all considered when we designed it.) -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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