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

When CPython evaluates `len(c)` for an instance `c` of a class `C`, how does it locate the `__len__` implementation?

class C: def __getattribute__(self, name): return object.__getattribute__(self, name) c = C() c.__len__ = lambda: 5 len(c) # ?