Skip to main content

← All terms · Standard library

itertools

Iterator building blocks — `chain`, `groupby`, `combinations`, `accumulate`. Lazy, memory-friendly.

Learn this interactively:

Open lesson lesson-130

Related — Standard library

pathlib.PathObject-oriented filesystem paths. `Path(".").rglob("*.py")` beats `os.walk + os.collections.CounterDict subclass that counts hashable items: `Counter("hello")` → `{'l': 2, ...}`.functools.cacheMemoize a pure function with `@functools.cache`. Replaces hand-rolled dict cachidataclasses.fieldConfigure a dataclass attribute — mutable defaults, init/repr behavior. Use `fie