20 Nov 2014 20 Nov '14
On Fri, Nov 21, 2014 at 3:21 AM, Nick Coghlan email@example.com wrote:
That does also suggest another possible alternative to the "or stop()" trick - allow *break* as an expression.
Or just as a keyword component of a comprehension, in the same way 'for' is. Since 'if' already has meaning, [x for x in range(10) if x
= 5 break] would be confusing, so probably it'd have to be the
slightly-awkward-to-read [x for x in range(10) break x >= 5], adding a termination condition to the preceding loop.