Don't use "object" as fallback return type in Google and Numpy docstrings

Because it breaks code insight otherwise. Type "object" is not the
same thing as "Any", and the latter isn't fully supported in PyCharm
yet. As a temporary solution insert empty line under "Returns" section
instead.
This commit is contained in:
Mikhail Golubev
2015-09-15 12:18:31 +03:00
parent 29a93d9145
commit afb33f77e8
3 changed files with 4 additions and 4 deletions
@@ -441,8 +441,8 @@ public class PyDocstringGenerator {
sectionBuilder.startReturnsSection();
boolean hasTypedReturns = false;
for (DocstringParam returnValue : returnValues) {
if (returnValue.getType() != null) {
sectionBuilder.addReturnValue(null, getDefaultType(returnValue), "");
if (StringUtil.isNotEmpty(returnValue.getType())) {
sectionBuilder.addReturnValue(null, returnValue.getType(), "");
hasTypedReturns = true;
}
}
@@ -6,6 +6,6 @@ def f(x, y):
y ():
Returns:
object:
"""
return 42
@@ -8,6 +8,6 @@ def f(x, y):
Returns
-------
object
"""
return 42