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

What does this print about CPython's reference counting, and why is the second number what it is?

import sys x = object() def f(a): return sys.getrefcount(a) print(sys.getrefcount(x)) print(f(x))