Re: Comprehensions

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <003701c4697a$75cd1e40$0d01a8c0@MarkVaio>
Paul Prescod wrote:

> Anyhow, generator comprehensions are more modern than list
> comprehensions and you can easily turn a generator comprehension into
> a list comprehension explicitly:
> 
> list(x*2 for x in a)

OK, I added this to the 1.0 list.

So this means I could say:

for x in a*b+3 for a in [1,2,4] for b in z if b.prime?(): 
      blah blah blah
Wow!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.