[Python-Dev] gc.garbage

Tim Peters tim.one@home.com
Sat, 17 Nov 2001 16:06:48 -0500


I notice the gc docs say:

    The following variable is provided for read-only access:
                                           ^^^^^^^^^^^^^^^^
    garbage
        A list of objects which the collector found to be unreachable ...

This isn't clear to me.  When I find finalizer cycles in gc.trash, I want to
clean them up by breaking the cycles.  Unless I remove the instances from
gc.trash too, their appearance in that list keeps them alive despite that
the cycles are broken.  But "read-only access" seems to imply "don't
mutate", and I don't believe that was intended.  True?  False?