Skip to content

Commit 665239f

Browse files
committed
define method docstrings properly
1 parent 5e4415b commit 665239f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

datatree/datatree.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def method_name(self, *args, **kwargs):
170170
method_docstring = method.__doc__
171171
if method_docstring is not None:
172172
updated_method_docstring = method_docstring.replace('\n', _MAPPED_DOCSTRING_ADDENDUM, 1)
173-
setattr(obj, f'{method_name}.__doc__', updated_method_docstring)
173+
obj_method = getattr(obj, method_name)
174+
setattr(obj_method, '__doc__', updated_method_docstring)
174175

175176

176177
# TODO equals, broadcast_equals etc.

0 commit comments

Comments
 (0)