You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/rhettinger'closed_at=<Date2012-08-15.05:40:23.091>created_at=<Date2011-10-23.22:32:47.616>labels= ['extension-modules', 'type-feature']
title='new decumulate() function in itertools module'updated_at=<Date2012-08-15.05:40:23.090>user='https://bugs.python.org/carloverre'
After in Python 3.2 the accumulate() function has been added to itertools module, for self-evident reasons of completeness and symmetry we could add in 3.3 the inverse decumulate() function, which, given the iterable argument p, yields p[0], p[1] - p[0], p[2] - p[1]... Its equivalent python form is in the attached file decumulate.py, below.
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".
I don't think this should go in itertools. It could go in the recipes at the bottom of the itertools doc, if you can provide some valid use cases (and possibly a patch too).
I also agree that the itertools module doesn't need this. (Reasons of "symmetry" are insufficient to make the module fatter that it already is). In addition, there are already a number of simple ways to do this.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: