代码之家  ›  专栏  ›  技术社区  ›  tarabyte

如何查找所有支持的python、restructuredtext字段名?

  •  1
  • tarabyte  · 技术社区  · 6 年前

    我想学的不仅仅是普通人 :param myparam: Some description 许多python模块中常见的文档样式,但还不能识别支持的字段名的完整列表。从例子中,我收集到 param , raises , returns .

    def my_method(self, someval):
        """Returns one plus the given value
        :param someval: an integer on which to operate
        :whatelseisthere:
        """
        return someval + 1
    

    http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

    1 回复  |  直到 6 年前
        1
  •  1
  •   mooglinux    6 年前

    可以找到字段名的完整列表 here:

    • 参数,参数,参数,参数,键,关键字: 参数的描述。
    • 类型: 参数的类型。如果可能,创建链接。
    • 引发,引发,异常: 引发了一个特定的异常。
    • var、ivar、cvar: 变量的描述。
    • 变量类型: 变量的类型。如果可能,创建链接。
    • 返回,返回: 返回值的描述。
    • rtype: 返回类型。如果可能,创建链接。