I am having a hard time wrapping my head around
why i can make timeit.Timer()
work with output from
functools.partial()
but not with output from itertools.starmap()
.
What I basically need is starmap(func, tuples)
to have the same 'attributes' as partial(func, one_arg_only)
but be more generally in the sense that I can actually pass into func multiple arguments at the same time.
What's the easiest workaround here ?
I tried timeit.Timer(starmap(func,tuples))
and obviously get the notorious error:
ValueError: stmt is neither a string nor callable
I presume this is coz starmap's output is not callable. But how do I work around this ?