Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonrefcounting and cyclic GCSingle-choice MCQ

Why might `gc.collect()` reclaim a self-referential list immediately while an equivalent reference cycle of plain integers never even enters the cyclic collector?

import gc lst = [] lst.append(lst) del lst gc.collect()