说我有以下代码:
def func(x, y = 1, z = 2):
""" A comment about this function """
return x + y + z
another_func = partial(func, z = 4)
记录another_func函数的正确或Pythonic方法是什么?
解决方法:
请参阅http://docs.python.org/library/functools.html#functools.partial上的partial()说明
像这样:
another_func.__doc__ = "My documentation"