DocInherit

tfsnippet.utils.DocInherit(kclass)

Class decorator to enable kclass and all its sub-classes to automatically inherit docstrings from base classes.

Usage:

import six


@DocInherit
class Parent(object):
    """Docstring of the parent class."""

    def some_method(self):
        """Docstring of the method."""
        ...

class Child(Parent):
    # inherits the docstring of :meth:`Parent`

    def some_method(self):
        # inherits the docstring of :meth:`Parent.some_method`
        ...
Parameters:kclass (Type) – The class to decorate.
Returns:The decorated class.