Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythondescriptorsSingle-choice MCQ

Why does accessing Spam.x below return the descriptor object itself rather than triggering its __get__?

class Desc: def __get__(self, obj, objtype=None): return 'got' class Spam(type): x = Desc() class Eggs(metaclass=Spam): pass print(Eggs.x)