标签:lib 函数 tin def tool return rgs module rom
def partial(func, *args, **keywords):
"""Copied from Python standard lib functools.
https://docs.python.org/2/library/functools.html#functools.partial
Simply importing from the standard module caused failure in UDFs.
"""
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
return func(*(args + fargs), **newkeywords)
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
return newfunc
标签:lib 函数 tin def tool return rgs module rom
原文地址:https://www.cnblogs.com/bregman/p/11811329.html