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


Groups > comp.lang.python > #68298

Re: What does gc.get_objects() return?

From Jurko Gospodnetić <jurko.gospodnetic@pke.hr>
Subject Re: What does gc.get_objects() return?
Date 2014-03-12 22:28 +0100
Organization PKE sistemi d.o.o.
References <lfqcr8$249$1@ger.gmane.org> <5320BD3F.5030509@mrabarnett.plus.com>
Newsgroups comp.lang.python
Message-ID <mailman.8104.1394659708.18130.python-list@python.org> (permalink)

Show all headers | View raw


   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ć

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


Thread

Re: What does gc.get_objects() return? Jurko Gospodnetić <jurko.gospodnetic@pke.hr> - 2014-03-12 22:28 +0100

csiph-web