如何以Google文档字符串格式格式化长行的参数描述

问题描述 投票:0回答:1

这是Google样式文档字符串的摘录:

def function_with_types_in_docstring(param1, param2):
    """Example function with types documented in the docstring.

    `PEP 484`_ type annotations are supported. If attribute, parameter, and
    return types are annotated according to `PEP 484`_, they do not need to be
    included in the docstring:

    Args:
        param1 (int): The first parameter.
        param2 (str): The second parameter.

    Returns:
        bool: The return value. True for success, False otherwise.

    .. _PEP 484:
        https://www.python.org/dev/peps/pep-0484/

    """

如果描述跨越一行,我该如何格式化args?

python styles args docstring
1个回答
1
投票
© www.soinside.com 2019 - 2024. All rights reserved.