A tour of the module itertools
summary
The module contains 20 tools and the talk demonstrates roughly 10 of them, claiming many are lazy like range laziness and work on any iterable. Examples include combinations and permutations for flavor pairs and cones, product to replace nested loops and generate test cases, chain/from_iterable to concatenate files without building large lists, islice to take the first 10 items from a product (used for a battleship bot), pairwise to avoid slice copies, count as an ID generator, and zip_longest filling missing values with None.
AI-written summary · about
chapters (9)
- 0:00Introduction and laziness
- 3:57Module overview and categories
- 7:45Combinatorial iterables
- 12:38Reshaping iterables
- 18:19Infinite iterables
- 21:27Filtering iterables
- 24:23Complementary tools
- 26:28Other tools and conclusion
- 28:14Q&A
related talks
32mIterating Efficiently in Python with itertools
03mReimplement `itertools` for fun & profit
29mPythonic iterators and generators
25mThe Standard Library Tour
24mMeta Generators: Playing Safe with Long Sequences
46mFunctional programming in Python with PyToolz
02h 28mFunctional Python
25mLazy Looping: The Next Iteration
