[Python-ideas] while conditional in list comprehension ??

Boris Borcic bborcic at gmail.com
Tue Jan 29 14:53:29 CET 2013


|>>> 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]





More information about the Python-ideas mailing list