[issue13252] new decumulate() function in itertools module

Nick Coghlan report at bugs.python.org
Mon Oct 24 12:45:05 CEST 2011


Nick Coghlan <ncoghlan at gmail.com> added the comment:

OK, looking at the code I realised what you're trying to get at is the idea of reporting the differences between values in a series, such that:

x = list(accumulate(seq))
assert x == list(accumulate(differences(x)))

I don't think the use cases are there to justify the addition (not every iterator we can think of should be a building block in itertools), but if such a thing were to be added, "differences" would convey the intention significantly better than the invented term "decumulate".

----------
nosy: +ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13252>
_______________________________________


More information about the Python-bugs-list mailing list