Chaining 501 generators breaks everything?

Andrey Fedorov anfedorov at gmail.com
Fri Feb 19 14:57:03 EST 2010


Ack, just ran it from shell, realized my editor was just choking on a
"maximum recursion depth exceeded" RuntimeError. Didn't realize generators
used the call stack...

- Andrey

On Fri, Feb 19, 2010 at 2:47 PM, Andrey Fedorov <anfedorov at gmail.com> wrote:

> I implemented a Sieve of Eratosthenes<http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes>primes algorithm using generators:
>
> http://gist.github.com/309109
>
>
> This code which chains together 500 generators works fine (~1/20th of a
> second) on my laptop. The code which chaines 501 generators (s/498/499/ on
> line 23) doesn't seem to finish.
>
> Does anyone know the reason for this, or can anyone point me where to look
> for a good explanation?
>
> Cheers,
> Andrey
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100219/af2dc074/attachment-0001.html>


More information about the Python-list mailing list