Alun Champion added the comment:
Understandable, though it would have also made the first order recurrence
relationships more accurate, e.g. annualized interest on an initial balance:
accumulate(repeat(None), lambda: bal, _: bal*1.05, initializer=1000)
vs. artificially repeating 1000
Alun Champion added the comment:
If you are looking for other examples.
Here's a wheel factorization of an indefinite sieve (primes) that was peer
reviewed on codereview.stackexchange.com, see the final result in the last post
by Will Ness:
http://codereview.stackexchange.com/questions/
New submission from Alun Champion:
itertools.accumulate should have an initializer with the same semantics as
functools.reduce.
These two functions are closely related, reduce only providing you the end
result accumulate providing an iterator over all the intermediate results.
However, if you
New submission from Alun Champion:
Currently if you append or appendleft when len(deque) == maxlen item from the
other end of the deque is discarded. These should return the discarded value to
allow you to write:
x = deque.append(y)
vs
if len(deque) == deque.maxlen():
x