smpl_doc.doc.insert_doc

smpl_doc.doc.insert_doc(original)[source]

Inserts the docstring from passed function original in the target function docstring.

Parameters

originalclass or function

orignal.__doc__ is inserted to the __doc__ of the target

Examples

>>> def ho():
...     '''Ho'''
...     print(ho.__doc__)
>>> @insert_doc(ho)
... def hi():
...     '''Hi'''
...     print(hi.__doc__)
>>> hi()
HoHi