December 2015
Beginner
442 pages
10h 12m
English
Now we have all the tools to appreciate how we can write our own custom iterator. Let's first define what is an iterable and an iterator:
__iter__ or __getitem__ methods are also iterables.__iter__ that returns the object itself, and an implementation for __next__, which returns the next item of the data stream until the stream is exhausted, at which point all successive calls to __next__ simply ...Read now
Unlock full access