>>> from toolz.itertoolz import accumulate
>>> list(accumulate(add, []))
Traceback (most recent call last):
File "/Users/nwani/m37/lib/python3.7/site-packages/toolz/itertoolz.py", line 59, in accumulate
result = next(seq) if initial == no_default else initial
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: generator raised StopIteration