ubermagutil.inherit_docs#

ubermagutil.inherit_docs(cls)#

Copy missing docstrings from parent classes.

Example

  1. Copy missing docstrings.

>>> import ubermagutil
>>> class A:
...     def __init__(self, a):
...         self.a  = a
...
...     def square(self):
...         return self.a**2
...
...     square.__doc__ = 'Docstring.'
...
>>> @ubermagutil.inherit_docs
... class B(A):
...     def square(self):
...         return self.a**2
...
>>> B.square.__doc__
'Docstring.'