Make sure your __getitem__ raises an IndexError for illegal indexes. If your __getitem__ function never raises an exception then it will loop forever. The for loop doesn’t make use of __len__.
The example you posted will raise an IndexError at the correct time because __getitem__ with 3 calls self.bob[3] which raises the error.
https://docs.python.org/3/reference/datamodel.html 28