![](https://secure.gravatar.com/avatar/282603f2d5efa01a880ab975632dd7ff.jpg?s=120&d=mm&r=g)
I see your point. I’m wondering if there’s a formatting convention or something that might suffice. Tried a couple but have’t come up with anything neat.
data = [x for x in iterable
break if x is None]
data = [x for x in utterable break if x is None]
I don’t necessarily think this makes the options any more difficult to parse than they were previously; advanced comprehensions can get a bit unwieldy already. With syntax highlighting a color coded “break” keyword separates the generation from the termination. On Jun 29, 2013, at 8:46 AM, Joshua Landau <joshua.landau.ws@gmail.com> wrote:
On 29 June 2013 11:09, Nick Coghlan <ncoghlan@gmail.com> wrote:
Rather than adding a new keyword, we could simply expand the syntax for the existing break statement to be this:
break [if <EXPR>] ... Once the break statement has been redefined this way, it *then* becomes reasonable to allow the following in comprehensions:
data = [x for x in iterable break if x is None]
Almost all of your proposal looks reasonable, but I personally find this quite hard to read; it should be written along the lines of (I'm not proposing this):
x for x in iterable; break if x is None
if one is to continue having syntax that is pseudo-correct English - a trait I am eager to to keep.
In summary, this is hard for me to read because there is no separation of the statements.
Because I have not other substantial objections, I'm -0 on this. If you can find a way to "fix" that, I'll be, for all intents and purposes, neutral. _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas