def inherits_docstring(f, context=None, fname=None, default=TRIGGER):
        """A decorator that returns a new DocFunc object.
          
          f - the function to decorate.
          context - the class/namespace where the function is bound, if known.
          fname - the function name in that context, if known.
          default - the docstring to return if none is found.

        """

        if context is not None:
            cls, namespace = context
            fname = fname or f.__name__
            f.__doc__ = DocFunc.get_doc(cls, fname, default, False)
            return f
        return DocFunc(f, default)
A decorator that returns a new DocFunc object.
          
          f - the function to decorate.
          context - the class/namespace where the function is bound, if known.
          fname - the function name in that context, if known.
          default - the docstring to return if none is found.

        
recipes/Python/577746_Inherit_Method_Docstrings_Using_Only/recipe-577746.py