Skip to content

Commit 8c1e85c

Browse files
authored
Handle case where description is empty (#140)
1 parent 5b1169f commit 8c1e85c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

doc/example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def foo(var1, var2, long_var_name='hi'):
6262
Explanation of return value named `describe`.
6363
out : type
6464
Explanation of `out`.
65+
type_without_description
6566
6667
Other Parameters
6768
----------------

numpydoc/docscrape_sphinx.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,12 @@ def _str_param_list(self, name, fake_autosummary=False):
200200
param_type)])
201201
else:
202202
out += self._str_indent([display_param])
203-
if desc:
204-
if self.use_blockquotes:
205-
out += ['']
206-
out += self._str_indent(desc, 8)
203+
if desc and self.use_blockquotes:
204+
out += ['']
205+
elif not desc:
206+
# empty definition
207+
desc = ['..']
208+
out += self._str_indent(desc, 8)
207209
out += ['']
208210

209211
return out

numpydoc/tests/test_docscrape.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ def no_period(self):
11471147
But a description
11481148
11491149
no_docstring2 : str
1150+
..
11501151
11511152
:obj:`multiline_sentence <multiline_sentence>`
11521153
This is a sentence.

0 commit comments

Comments
 (0)