On 01/06/2015 10:47 AM, Paul Moore wrote:
On 6 January 2015 at 18:43, Ethan Furman wrote:
Yup, it sure does. Guess I should have paid more attention to that niggling feeling that I was missing something. ;) On the other hand, I figured even if I was wrong it wouldn't hurt to increase awareness about the change to generators.
I should probably point out that when writing my code, I was conscious of the generator change and took special case of catching all of the StopIterations that might leak out. It's probably good that I was made to think carefully about it, but all those try...except blocks sure look ugly.
Having looked more closely at your code, I don't see any thing that wouldn't have had to be there even without the generator change because your exhausting two iterators.
(And Steven's version with its sentinel value doesn't look much better, with all those comparisons against a magic value
I think I prefer his, although I would rename MISSING to FINISHED. ;) -- ~Ethan~