def doctemplate(*args):
    """Return a decorator putting ``args`` into the docstring of the decorated ``func``.

    >>> @doctemplate('spam', 'spam')
    ... def spam():
    ...     '''Returns %s, lovely %s.'''
    ...     return 'Spam'

    >>> spam.__doc__
    'Returns spam, lovely spam.'
    """
    def decorator(func):
        func.__doc__ = func.__doc__ % tuple(args)
        return func
    return decorator
def doctemplate ( * args ) : def decorator ( func ) : func . __doc__ = func . __doc__ % tuple ( args ) return func return decorator
Return a decorator putting ``args`` into the docstring of the decorated ``func``.

    >>> @doctemplate('spam', 'spam')
    ... def spam():
    ...     '''Returns %s, lovely %s.'''
    ...     return 'Spam'

    >>> spam.__doc__
    'Returns spam, lovely spam.'