Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythondata model dunder dispatchSingle-choice MCQ

For implicit invocation of a special method, CPython looks the dunder up on the TYPE, bypassing the instance __dict__. Given the code below, what does len(c) print?

class C: def __len__(self): return 5 c = C() c.__len__ = lambda: 99 print(len(c))