β 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 cachiβ¦dataclasses.fieldConfigure a dataclass attribute β mutable defaults, init/repr behavior. Use `fieβ¦collections.defaultdictDict that auto-creates missing keys with a factory: `defaultdict(list)` returns β¦