"Gabriel Genellina" <gagsl-...@yahoo.com.ar> writes: > We're talking about the iter() builtin behavior, and that uses == > internally.
Oh, I see. Drat. > It could have used an identity test, and that would be better for this > specific case. But then iter(somefile.read, '') wouldn't work. Yeah, it should allow supplying a predicate instead of using == on a value. How about (untested): from itertools import * ... for row in takewhile(lambda x: x is sentinel, starmap(in_queue.get, repeat(()))): ... -- http://mail.python.org/mailman/listinfo/python-list