Is there any case where len(someObj) does not call someObj\'s __len__ function?
len(someObj)
__len__
I recently replaced the former with the latter in a (sucess
If __len__ returns a length over sys.maxsize, len() will raise an exception. This isn't true of calling __len__ directly. (In fact you could return any object from __len__ which won't be caught unless it goes through len().)
sys.maxsize
len()