4 ms·
That won't work, you have to use something like partial instead if you want to use the operator module: from functools import partial import operator
by Franciscouzo 8y ago
That won't work, you have to use something like partial instead if you want to use the operator module:
from functools import partial
import operator
double = partial(operator.mul, 2)
And at that point I think it would way simpler to just define a normal function.