The special method's let you hook into concepts, not so much built-in functions or other things.
__len__
is a container length, not specifically a hook for the len()
function. It just happens that the len()
function is the visible API for that functionality.
any()
expects an iterable argument, the concept you are looking for here is the Iterator type methods; it's not the function that is hooked, it is that concept.
You may want to study the default type abstract base classes to see what methods Python types implement; here many special methods are grouped together in a readable overview.