itertools.take?

Dan Williams dan at osheim.org
Mon Jul 14 22:37:00 EDT 2003


Is there any interest in adding a "Haskellish" take function to 
itertools? I know its easy enough to roll my own, I've been using:

take = lambda iter, n: [x for x in itertools.islice(iter, 0, n)]

which works, but I was wondering if it was common enough to get into 
itertools?

-Dan





More information about the Python-list mailing list