mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user