[Python-ideas] Reduce/fold and scan with generator expressions and comprehensions
Brendan Barnwell
brenbarn at brenbarn.net
Tue Oct 25 14:01:04 EDT 2016
On 2016-10-25 00:18, Danilo J. S. Bellini wrote:
>
> Well, see the itertools.accumulate examples yourself then, the ones at
> docs.python.org... We can start with something really simple like
> interest rates or uniform series, but... before arguing here, please
> convince other people to update the Wikipedia:
>
> "Recurrence relations, especially linear recurrence relations, are used
> extensively in both theoretical and empirical economics."
> https://en.wikipedia.org/wiki/Recurrence_relation#Economics
> <https://en.wikipedia.org/wiki/Recurrence_relation#Economics>
The fact that that page is about recurrence relations supports the
position that your proposed change is too specific. Recurrence
relations are much more general than just "have access to the previous
value". They may have access to any of the earlier values, and/or
multiple earlier values. So if what we wanted was to able to use
recurrence relations, your proposal would be insufficient.
--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no
path, and leave a trail."
--author unknown
More information about the Python-ideas
mailing list