summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/ext/napoleon/docstring.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py
index 20d9e1b9e..bcd2d2426 100644
--- a/sphinx/ext/napoleon/docstring.py
+++ b/sphinx/ext/napoleon/docstring.py
@@ -1240,14 +1240,13 @@ class NumpyDocstring(GoogleDocstring):
for func, description, role in items
]
- func_role = 'obj'
lines = [] # type: List[str]
last_had_desc = True
- for func, desc, role in items:
+ for name, desc, role in items:
if role:
- link = ':%s:`%s`' % (role, func)
+ link = ':%s:`%s`' % (role, name)
else:
- link = ':%s:`%s`' % (func_role, func)
+ link = ':obj:`%s`' % name
if desc or last_had_desc:
lines += ['']
lines += [link]