Advanced Python
Q70 / 101

How does Python's garbage collector handle reference cycles?

Correct! Well done.

Incorrect.

The correct answer is B) Reference counting handles most objects; a cyclic garbage collector periodically identifies and collects reference cycles

B

Correct Answer

Reference counting handles most objects; a cyclic garbage collector periodically identifies and collects reference cycles

Explanation

CPython uses reference counting as the primary mechanism. Because cycles prevent counts from reaching zero, a generational cyclic GC (gc module) handles them.

Progress
70/101