def as_method(self, docstring=""):
        """
        Converts this action to a function or method.
          An optional docstring may be passed.
        """
        method = lambda obj, *args, **kwargs: self(obj, *args, **kwargs)
        if docstring:
            method.__doc__ = docstring
        return method
def as_method ( self , docstring = "" ) : method = lambda obj , * args , ** kwargs : self ( obj , * args , ** kwargs ) if docstring : method . __doc__ = docstring return method
Converts this action to a function or method.
          An optional docstring may be passed.