1 min readMay 9, 2020
Good introduction. One minor quibble, though. The methods __getitem__
, __setitem__
and __len__
don’t have anything to do with iteration as the article suggests. They are for indexing.
For iteration the methods __next__
and __iter__
are more relevant.