def usedoc(other):
def inner(fnc):<EOL><INDENT>fnc.__doc__ = fnc.__doc__ or getattr(other, '<STR_LIT>')<EOL>return fnc<EOL><DEDENT>return inner<EOL>
Decorator which copies __doc__ of given object into decorated one.

Usage:

>>> def fnc1():
...     """docstring"""
...     pass
>>> @usedoc(fnc1)
... def fnc2():
...     pass
>>> fnc2.__doc__
'docstring'collections.abc.D

:param other: anything with a __doc__ attribute
:type other: any
:returns: decorator function
:rtype: callable