How to document a method with parameter(s)?

前端 未结 8 1800
情书的邮戳
情书的邮戳 2020-12-07 07:52

How to document methods with parameters using Python\'s documentation strings?

EDIT: PEP 257 gives this example:

d         


        
8条回答
  •  孤城傲影
    2020-12-07 08:14

    Based on my experience, the numpy docstring conventions (PEP257 superset) are the most widely-spread followed conventions that are also supported by tools, such as Sphinx.

    One example:

    Parameters
    ----------
    x : type
        Description of parameter `x`.
    

提交回复
热议问题