pytools.api.appenddoc#

pytools.api.appenddoc(*, to, prepend=False)[source]#

A decorator that appends the docstring of the decorated method to the docstring of another method.

Useful especially if an __init__ method is defined in a base class, and the docstring of the derived class’s __init__ method defines additional parameters.

Parameters:
  • to (Callable[..., Any]) – the other method to append the docstring to

  • prepend (bool) – if True, prepend the docstring of the decorated method to the docstring of the other method, otherwise append it

Return type:

Callable[[TypeVar(T_Method, bound= Callable[..., Any])], TypeVar(T_Method, bound= Callable[..., Any])]

Returns:

the actual decorating function