I'm new to using partial
functions in Python. Here's a piece of simple code, and I am expecting it to print out results, but somehow it doesn't print anything, or say otherwise show that firstfunc
gets executed:
from functools import partial
class zebra(object):
def firstfunc(self, a, b, c):
res = 3*a + 55*b + c
print(res)
return res
def partial_func(self, a, c):
return partial(self.firstfunc, b = 2)
myzebra = zebra()
alist = [1, 2, 3, 4]
blist = [7, 8, 9, 11]
map(myzebra.partial_func, alist, blist)