Ben Finney <[EMAIL PROTECTED]> writes:
> > If, instead, it makes sense for the results to be iterated over, you > can write a function that yields results one at a time, without > necessarily knowing in advance what the entire set will be:: > > >>> def fib(max_result): Going off on a tangent a bit, but I was idly considering the absence of itertools.ireduce the other day. A problem is that reduce gives a single result, so it's not clear what ireduce would do (perhaps why it's not there). One obvious candidate would be to give the whole sequence of partial reductions. I'm not sure if this would be generally useful, but it would give a succinct way to do the Fibonacci sequence: itertools.ireduce(operator.add, itertools.count()) -- http://mail.python.org/mailman/listinfo/python-list