Return a decorator to borrow docstring from another cls.`methodname`
It should not be used for __init__ methods of classes derived from ClassWithCollections since __doc__’s of those are handled by the AttributeCollector anyways.
Common use is to borrow a docstring from the class’s method for an adapter function (e.g. sphere_searchlight borrows from Searchlight)
Parameters : | cls :
methodname : None or str
|
---|
Examples
To borrow __repr__ docstring from parent class Mapper, do:
@borrowdoc(Mapper)
def __repr__(self):
...