def partial(func, args, *keywords):
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
python標準函式庫裡面的程式碼,請問
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
這三句話好像沒什麼用處?