<br><div><span class="gmail_quote">On 3/27/06, <b class="gmail_sendername">Raymond Hettinger</b> <<a href="mailto:raymond.hettinger@verizon.net">raymond.hettinger@verizon.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Modified:<br>> python/trunk/Modules/itertoolsmodule.c<br>> Log:<br>><br>> Make itertools.tee and its internal teedataobject participate in GC. This<br>> alone does not solve the leak in test_generators, unfortunately, but it is
<br>> part of test_generators' problem and it does solve other cycles.<br><br>Thanks for getting this in.<br><br>To get the leak in test_generators, I think you make need to add GC to the<br>teeobject as well as the teedataobject.
</blockquote><div><br>The teeobject has GC (hence the word 'and' in 'itertools.tee and its internal teedataobject' ;-) The problem with test_generators is that this also leaks:<br><br>def leak():<br> def gen():<br> while True:
<br> yield g<br> g = gen()<br><br>leak()<br><br>It doesn't leak in 2.4. I'm using a little shell script to work backwards through the 2.5 changes to find out which one introduced this, although I somehow suspect it's the coroutine stuff... ;P
<br><br></div></div>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!