Daniel Schüle wrote:

> I am wondering if there were proposals or previous disscussions in this 
> NG considering using 'while' in comprehension lists
> 
> # pseudo code
> i=2
> lst=[i**=2 while i<1000]
> 
> of course this could be easily rewritten into
> i=2
> lst=[]
> while i<1000:
>      i**=2
>      lst.append(i)
> 

Neither of these loops would terminate until memory is exhausted. Do you 
have a use case for a 'while' in a list comprehension which would 
terminate?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to