J
jsaul
Hi there,
wouldn't it be useful to have a 'while' conditional in addition to
'if' in list comprehensions?
foo = []
for i in bar:
if len(i) == 0:
break
foo.append(i)
would then turn into
foo = [ i for i in bar while len(i)>0 ]
Is there any reason for not having this kind of thing? I actually
miss it pretty often.
Cheers, jsaul
wouldn't it be useful to have a 'while' conditional in addition to
'if' in list comprehensions?
foo = []
for i in bar:
if len(i) == 0:
break
foo.append(i)
would then turn into
foo = [ i for i in bar while len(i)>0 ]
Is there any reason for not having this kind of thing? I actually
miss it pretty often.
Cheers, jsaul