On this page
  1. itertools.starmap
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

itertools.starmap

Prev: itertools.repeat | Up: itertools | Next: itertools.takewhile
Rel: itertools.accumulate, itertools.batched, itertools.chain, itertools.combinations
Ref: docs.python.org — itertools.starmap
Tags: #public #python3 #stdlib #itertools


Import

import itertools
from itertools import starmap

Signature & Overview

itertools.starmap(function, iterable, /)

Return an iterator whose values are returned from the function evaluated with an argument tuple taken from the given sequence.

Usage

from itertools import starmap

pairs = [(2, 5), (3, 2), (10, 3)]
assert list(starmap(pow, pairs)) == [32, 9, 1000]

Gotchas

REPL Inspect

from itertools import starmap
help(starmap)

Linked from

Related notes