python partial偏函数

python partial偏函数

from functools import partial

def func(a,b,c,d):
    return a + b + c + d

tes = partial(func,1)
print(tes)
res = tes(2,3,4)
print(res)

 

posted @ 2020-03-20 16:38  Hank·Paul  阅读(234)  评论(0编辑  收藏  举报