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

Nick Coghlan ncoghlan at gmail.com
Tue Jan 29 12:53:00 CET 2013


On Tue, Jan 29, 2013 at 8:59 PM, Shane Green <shane at umbrellacode.com> wrote:
> Unfortunately "else break" also kind of falls flat on its face when you
> consider it's being used in context of an expression.

Not really, since comprehensions are all about providing expression
forms of the equivalent statements. I'm not saying "else break" would
get approved (I actually don't think that's likely for other reasons),
just that it isn't clearly dead in the water due to the inconsistency
with the statement semantics (which is the core problem with the
"while" suggestion).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list