Skip to content

Py37: accumulate raises StopIteration when input list is empty #409

@nehaljwani

Description

@nehaljwani
>>> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions