On Thu, Jul 11, 2013 at 2:54 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > As promised. Apologies for the excessive commenting. As noted, this > implementation is a recursive generator, which is done so that the > primes in the sieve can go only up to the square root of the current > prime, rather than tossing in every prime seen so far. >
Nice. Comes in at 0.23369310904039478 in my oh-so-scientific benchmarking, so it's comparable to several of Steven's algorithms. Runs on Python 3.3 with just the tiny tweak of converting iter.next() to next(iter). ChrisA -- http://mail.python.org/mailman/listinfo/python-list