From bb0ae9d446e3b64210bfc3e944913497b68174ac Mon Sep 17 00:00:00 2001 From: Laurent Gautier Date: Sat, 7 Mar 2020 16:55:20 -0500 Subject: [PATCH] Fixed docstring building. --- rpy2/robjects/functions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rpy2/robjects/functions.py b/rpy2/robjects/functions.py index 10bf1b0c3..b1371737d 100644 --- a/rpy2/robjects/functions.py +++ b/rpy2/robjects/functions.py @@ -327,8 +327,10 @@ def map_signature( def wrap_r_function( r_func: SignatureTranslatedFunction, name: str, *, is_method: bool = False, full_repr: bool = False, - map_default: typing.Callable[[rinterface.Sexp], - typing.Any] = _map_default_value + map_default: typing.Optional[ + typing.Callable[[rinterface.Sexp], + typing.Any] + ] = _map_default_value ) -> typing.Callable: """ Wrap an rpy2 function handle with a Python function with a matching signature. @@ -364,9 +366,10 @@ def wrapped_func(*args, **kwargs): value = r_func(*args, **kwargs) return value + docstring = [] if is_method: - docstring = ['This method of `{}` is implemented in R.' - .format(is_method._robj.rclass[0])] + docstring.append('This method of `{}` is implemented in R.' + .format(is_method._robj.rclass[0])) else: docstring.append('This function wraps the following R function.')