As explained in the documentation for gc.garbage, there is no guarantee that leaks will not occur; in particular, cyclic objects with methods are __del__not collected by default. For such objects, cyclic links must be broken manually to enable an additional GC.
From what I understand, looking at the code of the CPython code , the interpreter keeps links to all objects under its control. An "additional" garbage collector runs the algorithm with a label and a sweep through the heap, remembers for each object if it is accessible from the "outside" and, if not, deletes it. (GC generational , but it can be explicitly started from a module gcwith an argument generation.)
, , , "" GC , , , , Python. , .