How to make an empty generator?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu Feb 18 19:36:10 EST 2010


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



More information about the Python-list mailing list