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


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

Re: What does gc.get_objects() return?

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2014-03-12 16:35 -0600
Last post2014-03-12 16:35 -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:35 -0600

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

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-12 16:35 -0600
SubjectRe: What does gc.get_objects() return?
Message-ID<mailman.8107.1394663762.18130.python-list@python.org>
On Wed, Mar 12, 2014 at 3:44 PM, Chris Angelico <rosuav@gmail.com> wrote:
> The concept is that the GC tracks (in that sense; everything in
> CPython is refcounted, but that's not what these functions look at)
> anything that could be a part of a reference cycle. That's all it
> concerns itself with, so something that can't have references to
> arbitrary objects can't possibly be worth tracking. Interestingly, a
> tuple of integers is tracked:
>
>>>> a=1,2,3
>>>> gc.is_tracked(a)
> True
>
> 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

[toc] | [standalone]


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


csiph-web