-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I'm trying to do some experiments with pipetools:
@pipe_util
def myaggregate(function):
return partial(functools.reduce, function)
ret = glob.iglob | foreach(readf) | flatten | foreach(len) | myaggregate(operator.add)
print(ret(path))
and it works. But I'm trying to replace flatten with more_itertools.flatten for speed reason:
ret = glob.iglob | foreach(readf) | (more_itertools.flatten) | foreach(len) | myaggregate(operator.add)
print(ret(path))
with more_itertools.flatten takes 6.49 seconds, with flatten 13.68 seconds.
I have tried with:
@pipe_util
def myflatten():
return partial(more_itertools.flatten)
but it doesn't work, what am I missing?
Thanks
Metadata
Metadata
Assignees
Labels
No labels