On 3/27/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> Modified:
>   python/trunk/Modules/itertoolsmodule.c
> Log:
>
> Make itertools.tee and its internal teedataobject participate in GC. This
> alone does not solve the leak in test_generators, unfortunately, but it is
> part of test_generators' problem and it does solve other cycles.

Thanks for getting this in.

To get the leak in test_generators, I think you make need to add GC to the
teeobject as well as the teedataobject.

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:

def leak():
    def gen():
        while True:
            yield g
    g = gen()

leak()

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

--
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to