def iscanl(col, func=add, acc=None):
'''
Fold a collection from the left using a binary function
and an accumulator into a stream of values
'''
if acc is not None:
col = chain([acc], col)
for element in itools.accumulate(col, func):
yield element
评论列表
文章目录