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


Groups > comp.lang.python > #68303 > unrolled thread

Re: What does gc.get_objects() return?

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2014-03-12 16:40 -0600
Last post2014-03-12 16:40 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#68303 — Re: What does gc.get_objects() return?

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-12 16:40 -0600
SubjectRe: What does gc.get_objects() return?
Message-ID<mailman.8108.1394664046.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web