[ x for x in xrange(10) when p(x) ]

George Sakkis gsakkis at rutgers.edu
Wed Nov 9 22:47:40 EST 2005


"Alex Martelli" wrote:

> bon... at gmail.com <bon... at gmail.com> wrote:
>
> > FP functions like dropwhile/takewhile etc.
>
> No way -- the itertools module is and remains a PRECIOUS resource.
> If you want an iterator rather than a list, itertools.ifilter is quite
> appropriate here.

What about the future of itertools in python 3K ? IIRC, several
functions and methods that currently return lists are going to return
iterators. Could this imply that itertools.(imap/ifilter/izip) will
take the place of map/filter/zip as builtins ?

George




More information about the Python-list mailing list