In Python, if I wanted to use explicit functional-style programming to sum up a list, I could do
>>> import operator
>>> reduce(operator.add, [3, -1, 2])
4
Mathematica, being closer to a pure functional language than Python, calls it Fold instead of reduce, but the outcome is the same.
In[1]:= Fold[Plus, {3, -1, 2}]
Out[1]= 4
So now, in Mathematica, if I wanted to get the result of the "fold" at every step during the iteration, I could use the function FoldList.
In[2]:= FoldList[Plus, {3, -1, 2}]
Out[2]= {3, 2, 4}
How do I get such a list (or preferably an iterator) in Python? In general, does this functional operation have a name?