What does gc.get_objects() return?

J

Jurko Gospodnetiæ

Hi all.

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?

For example (done using CPython 3.4 interactive interpreter) here it
does not contain an object I know exists:

but here it does:

It also does not seem to contain string objects. At first I thought
that perhaps interned strings were not placed under GC control, so I
tested this:

Which shows that non-interned scripts such as these are not getting
listed in gc.get_objects() either. :-s

Many thanks.

Best regards,
Jurko Gospodnetiæ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,117
Latest member
Matilda564
Top