scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
inherit_docstring_from(cls)

If the decorated method has no docstring, it is simply given the docstring of `cls`s method.

Parameters

cls : Python class or instance

A class with a method with the same name as the decorated method. The docstring of the method in this class replaces '%(super)s' in the docstring of the decorated method.

Returns

f : function

The decorator function that modifies the __doc__ attribute of its argument.

This decorator modifies the decorated function's docstring by replacing occurrences of '%(super)s' with the docstring of the method of the same name from the class :None:None:`cls`.

Examples

In the following, the docstring for Bar.func created using the docstring of :None:None:`Foo.func`.

>>> class Foo:
...  def func(self):
...  '''Do something useful.'''
...  return ...
>>> class Bar(Foo):
...  @inherit_docstring_from(Foo)
...  def func(self):
...  '''%(super)s Do it fast. '''
...  return ...
>>> b = Bar()
... b.func.__doc__ 'Do something useful. Do it fast. '
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/_lib/doccer.py#69
type: <class 'function'>
Commit: