On Mon, Dec 8, 2014 at 5:27 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > On Dec 7, 2014 8:31 AM, "Ned Batchelder" <n...@nedbatchelder.com> wrote: >> NOTE: THIS EXAMPLE IS HORRIBLE. This code is crazy-confusing, and should >> never have been used as an example of iteration. It layers at least three >> iterations on top of each other, making it very difficult to see what is >> going on. It uses "while iters" where "while True" would do exactly the >> same thing (iters will never be false). > > That's not quite correct; the "while iters" actually guards against the case > where the passed args are empty. With no sub-iterators, no StopIteration > would ever be raised, and the result would be an infinite generator of empty > tuples. The "while iters" makes it return immediately instead. > > So it seems this example is even more confusing than you thought.
I'm actually glad PEP 479 will break this kind of code. Gives a good excuse for rewriting it to be more readable. ChrisA -- https://mail.python.org/mailman/listinfo/python-list