On Mar 7, 7:49 am, [EMAIL PROTECTED] wrote:
> I find itertools.islice() useful, so for Python 3.x I may like to see
> it removed from the itertools module, and the normal slicing syntax
> [::] extended to work with generators/iterators too.
>
> from itertools import islice
> primes = (x for x in xrange(1,999) if all(x % y for y in xrange(2,
> x)))
> print list(islice(primes, 0, 20))
> ==>
> print list(primes[:20])
>
> Bye,
> bearophile

I had posted some time ago an OO wrapper of itertools; slice notation
for islice was one motivation: 
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498272

George
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to