Correct. And that is exactly why I am confused. How it even knows that it should call it 5 times (or in fact even 6!).
__getitem__ doesn’t tell how many items are there. list() doesn’t know that self.arr is the iterable it needs to iterate over. I thought that it should check len(dataset) first and then iterate over the length of the dataset. This sounds logical to me.
And I fail to understand how it iterates over more items…