小编Ric*_*kon的帖子

如何解决pydocstyle错误“D205:摘要行和描述之间需要1个空行(发现0)”?

我正在尝试使用 pydocstyle 检查我的文档字符串的质量,但出现此错误:

D205: 1 blank line required between summary line and description (found 0)

这是我的代码的样子

def func(input):
    """

    Function that does something interesting.
        Args:
            -input- Input of the function

    Returns:
        output- Output of the function

    """
    data = words + sentences
    corpus= somefunction(data)
Run Code Online (Sandbox Code Playgroud)

当我在文档字符串和函数语句之间添加一个空行时;

def func(input):
    """

    Function that does something interesting.
        Args:
            -input- Input of the function

    Returns:
        output- Output of the function

    """

    data = words + sentences
    corpus= somefunction(data)
Run Code Online (Sandbox Code Playgroud)

我得到这个错误:

D202: No blank lines allowed after …

python docstring

12
推荐指数
1
解决办法
9278
查看次数

标签 统计

docstring ×1

python ×1