Skip to content

Commit

Permalink
Fixed docstring building.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgautier committed Mar 7, 2020
1 parent f3ee456 commit bb0ae9d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions rpy2/robjects/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.')

Expand Down

0 comments on commit bb0ae9d

Please sign in to comment.