This returns what you'd expect:
class My(object):
def __len__(self):
return 6
a = My()
print(len(a))
But this throws an error:
class My2(object):
pass
b = My2()
b.__len__ = lambda x: 6
print(len(b))
TypeError: object of type 'My2' has no len()
Why?
callable(lambda x: x)returningTrue. And next time maybe you'll want to avoid ending your statements with question marks.