On Thu, 18 Feb 2010 18:12:10 -0600, Robert Kern wrote: > He wants an iterator that executes some given side-effect-producing code > then immediately raises the StopIteration. Ah, that's the bit I missed! Yewww. Programming by side-effect... I hope the original poster has a good reason for such a thing. -- Steven