Python’s itertools package provides you with a tonne of iterators. In this episode, we take a whirlwind tour of all the things itertools has to offer, and also stumble onto some of the problems that you generally encounter with itertools.
Gist for the code: https://gist.github.com/gamesbrainiac...
00:00 - Introduction
00:16 - itertools.count
00:55 - itertools.islice
01:42 - Moving Iterators Forward
02:44 - StopIteration Exception
03:27 - itertools.tee
04:07 - itertools.repeat
04:36 - What makes an Iterator
05:27 - itertools.accumulate
06:21 - itertools.cycle
07:14 - itertools.chain
07:52 - itertools.zip_longest
08:32 - itertools.groupby
09:34 - Comparison with SQL’s GROUP BY command
11:37 - More Itertools (more_itertools)
14:39 - Itertools for Asynchronous Code
14:57 - Outro
コメント