Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68303

Re: What does gc.get_objects() return?

References <lfqcr8$249$1@ger.gmane.org> <5320BD3F.5030509@mrabarnett.plus.com> <lfqjgu$kug$1@ger.gmane.org> <CAPTjJmqdKZ6qDQ+PZAdxVF-hKN=txKh35ga_C451C2z_hpZZAA@mail.gmail.com> <CALwzidn4o-z=wvGS89-WvL=DivBm0T3GSbTV0qcUJFE5zmo2XA@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2014-03-12 16:40 -0600
Subject Re: What does gc.get_objects() return?
Newsgroups comp.lang.python
Message-ID <mailman.8108.1394664046.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Mar 12, 2014 at 4:35 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>> So not all optimizations are done that could be done.
>
> Or is it?
>
>>>> a = 1,2,3
>>>> gc.is_tracked(a)
> True
>>>> gc.collect()
> 0
>>>> gc.is_tracked(a)
> False

I guess the reason for this is that when PyTuple_New is called, it
knows how many elements it will contain but doesn't know yet what they
are, so it defers the issue by just going ahead and adding itself to
the GC

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: What does gc.get_objects() return? Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-12 16:40 -0600

csiph-web