A tour of the module itertools

PyCon Italia 2025


Do you know the 20 tools available in the module itertools?

Join me as I show you what’s inside this insanely useful Pandora box!

Abstract

This talk walks you through the 20 tools available in itertools, a module you should be proficient in if you aspire to write Python code that makes efficient use iterables.

The talk proposes splitting the module itertools in 5 categories of iterables: combinatorial, reshaping, infinite, filtering, and complementary.

For each category, we will explore the tools available, look at examples of usage, and understand when each iterable can be useful.

Oh, and there’s also tee. Let us not forget tee!

Watch the recording