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

A program creates many short-lived tuples whose elements are all immutable (ints and strings). Profiling shows the cyclic collector almost never visits them. What runtime optimization explains this?

import gc t = (1, 'a', 2) gc.collect() print(gc.is_tracked(t)) # False after the collection untracks it