Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPython__slots__ layoutSingle-choice MCQ

A slotted class is created and someone tries to take a weak reference to an instance. What governs whether this succeeds?

import weakref class A: __slots__ = ('x',) weakref.ref(A()) # ?