I think the following example might help in understanding
>>> class X:
...     def __init__(self):
...             self.arr = [1, 2, 3]
...     def __getitem__(self, idx):
...             print('getting: ', idx)
...             return self.arr[idx]
...
>>> x = X()
>>> list(x)
getting:  0
getting:  1
getting:  2
getting:  3
[1, 2, 3]

I guess the list function results in calling the getitem function for each element.
Since, the dataset class is pretty much an abstract class in which one has to implement the __getitem__function. The len function allows one to have a custom size for the dataset separate from the actual iteratable object size.