On Tue, Jul 6, 2010 at 12:50, Graham Dumpleton <graham.dumpleton at gmail.com> wrote: > In the code example I posted I never had a 'return' statement in same > function as 'yield'. You shouldn't be mixing the two. Well, you can still use bare "return" as a way of raising StopIteration. Cheers, Dirkjan