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...<div><br></div><div>- Andrey</div><div><br>

<div class="gmail_quote">On Fri, Feb 19, 2010 at 2:47 PM, Andrey Fedorov <span dir="ltr"><<a href="mailto:anfedorov@gmail.com" target="_blank">anfedorov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I implemented a <a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes" target="_blank">Sieve of Eratosthenes</a> primes algorithm using generators:</div>


<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">

<div><a href="http://gist.github.com/309109" target="_blank">http://gist.github.com/309109</a></div></blockquote><div><br></div><div>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.</div>




<div><br></div><div>Does anyone know the reason for this, or can anyone point me where to look for a good explanation?</div><div><br></div><div>Cheers,</div><div>Andrey</div>
</blockquote></div><br></div>