How should I comment on Python partial functions?

Let's say I have the following code:

def func(x, y = 1, z = 2): """ A comment about this function """ return x + y + z another_func = partial(func, z = 4) 

What would be the correct or Pythonic way to document another_func function?

+4
source share
1 answer

See the description of partial () at http://docs.python.org/library/functools.html#functools.partial

Like this:

 another_func.__doc__ = "My documentation" 
+5
source

All Articles