Jan. 28, 2013
3:17 p.m.
On Mon, Jan 28, 2013 at 9:51 AM, Shane Green <shane@umbrellacode.com> wrote:
Yeah, I realized (1) after a minute and came up with "else break": if n < 400 else break. Could that be functionally equivalent, not based on a loop construct within an iterator?
You mean: `[n for n in range(0, 400) if n < 100 else break]`? That is definitely more obvious (in my opinion) than using the while syntax, but what does `break` mean in the context of a list comprehension? I understand the point, but I dislike the execution. I guess coming from a background in pure mathematics, this just seems wrong for a list (or set) comprehension.