python 偏函数

from functools import partial


def test(x, y):
    return x + y


# 1.普通函数调用
ret = test(1, 2)
print(ret)      # 3

# 2.偏函数调用
new_test = partial(test, 10)
ret = new_test(2)
print(ret)      # 12

 过程:导入模块->创建新的函数

原文地址:https://www.cnblogs.com/wt7018/p/11605215.html