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


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

Re: What does gc.get_objects() return?

Started byJurko Gospodnetić <jurko.gospodnetic@pke.hr>
First post2014-03-12 22:28 +0100
Last post2014-03-12 22:28 +0100
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? Jurko Gospodnetić <jurko.gospodnetic@pke.hr> - 2014-03-12 22:28 +0100

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

FromJurko Gospodnetić <jurko.gospodnetic@pke.hr>
Date2014-03-12 22:28 +0100
SubjectRe: What does gc.get_objects() return?
Message-ID<mailman.8104.1394659708.18130.python-list@python.org>
   Hi.

On 12.3.2014. 21:02, MRAB wrote:
>>     I was wondering if someone could explain gc.get_objects() in a bit
>> more detail to me.
>>
>>     Does it return a list of 'all objects known to Python'? Only some of
>> them? Which does it return? Which it does not?
>>
>
> gc.is_tracked(...) might be relevant to your question.

   Thanks! The documentation for gc.is_tracked() straightened me out. :-)

   So gc.collect() returns a list of all the objects GC is in charge of, 
and which instances are and are not tracked by the GC is, I guess, an 
interpreter implementation detail.

   For CPython 3.4 I guess strings and other atomic types such as ints 
are not, as well as raw object() instances. Custom class instances on 
the other hand seem to be under GC control.

   Thanks again.

   Best regards,
     Jurko Gospodnetić

[toc] | [standalone]


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


csiph-web