Using combinatorial functions in the itertools module
[Posted June 17, 2003 by cook]
David Mertz
discusses combinational iterators in Python on IBM's developerWorks.
"
Python 2.2 introduced simple generators to the Python language and reconceived standard loops in terms of underlying iterators. With Python 2.3, generators become standard (no need for _future_), and the new module itertools is introduced to work flexibly with iterators. The itertools module is essentially a set of combinatorial higher-order functions, but ones that work with lazy iterators rather than with finite lists. In this installment, David explores the new module, and gives you a sense of the new expressive power available with combinatorial iterators."
(
Log in to post comments)