How funny… I tried a variation of that because one of my original thoughts had been "[… if x else raise StopIteration()]" may have also made some sense. But I tried it based on the example from earlier, and hadn't even considered it was even closer….
|>>> def notyet(cond) :
if cond :
raise StopIteration
return True
|>>> list(x for x in range(100) if notyet(x>10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas