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

Which statement most accurately describes why sys.getrefcount(x) reports a value one higher than the number of names you assigned, and how immortal objects appear?

import sys x = object() print(sys.getrefcount(x)) # e.g. 2 print(sys.getrefcount(None))